Answer Posted / sreekumar
A scalar query returns exactly one column value from one row.
If it returns 0 rows, then the value scalar query is NULL. If returns more than one row, then Oracle returns an error.
eg.
select first_name, last_name,
(select job_title
from jobs
where employees.job_id = jobs.job_id) job_title
from employees
where rownum < 5;
Note :Use this method only as your last option in the coding..:) performance wise this is bad.
-Sreekumar
Oracle 10g DBA
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What is a null value?
Why do we need unique key in a table?
What are crud methods?
What is procedure function?
When a dml statement is executed, in which cursor attributes, the outcome of the statement is saved?
What is a .db file?
How do you delete duplicates in sql query using rowid?
what is 'mysqlimport'? : Sql dba
What is a design view?
Why is stored procedure faster than query?
Which is better stored procedure or query?
How do I tune a sql query?
What is a unique constraint?
Can I create table without primary key?
How to know the last executed procedure?