In Oracle, subqueries are the queries inside a query. Subqueries can be made using WHERE, FROM or SELECT clause.
Table 1: employee1
Table 2: employee2
Example 1
Query: Select name, city from employee1 where id in (select id from employee2 where designation=’Shareholder’)
Example 2
Query: Select e.id, e.city, e.name, e1.designation from employee1 e join employee2 e1 on (e.id = e1.id)
Leave a Reply