Saturday, 22 November 2014

Single row subquery



       In Single row subquery, inner query returns 'Zero or One' row. Based on the inner query result outer query will return output. The operators that can be used with single-row subqueires are =, >, >=, <, <=, and <>.

Example:
           Employee table
           Department table


SELECT * FROM EMPLOYEE
WHERE Dept_ID =
(
      SELECT
      DEPTID
      FROM DEPT
      WHERE DeptID = 10
)


No comments:

Post a Comment