Scalar Subquery


A scalar row subquery is a single-row subquery. In other words, it returns a single row. If the scalar subquery returns more than one row, it generates an error. The Oracle 9 i version has more support of scalar subqueries than Oracle 8 i .

FOR EXAMPLE

 
 SELECT city, state,       (SELECT count(*)          FROM student s         WHERE s.zip = z.zip) as student_count   FROM zipcode z  WHERE state = 'CT' 


Oracle PL[s]SQL by Example
Oracle PL[s]SQL by Example
ISBN: 3642256902
EAN: N/A
Year: 2003
Pages: 289

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net