In Oracle, subquery is a query within a query. In other words nested query. The subquery can be creates with WHERE clause, FROM clause or with SELECT clause.
The subquery can be used with the WHERE clause and called nested subqueries, use the following syntax:
In the above example, we are retrieving all the records from "tblCustomerLoan" table, if firstName found in the subquery.
In the above example, subquery has been aliased with the name subquery1 and used to reference for its any fields.