Where We Can Use Subquery in Sql
You Can Place the Subquery in a Number of Sql Clauses: Where Clause, Having Clause, from Clause. Subqueries Can Be Used with Select, Update, Insert, Delete...
You can place the Subquery in a number of SQL clauses: WHERE clause, HAVING clause, FROM clause. Subqueries can be used with SELECT, UPDATE, INSERT, DELETE statements along with expression operator. It could be equality operator or comparison operator such as =, >, =, <= and Like operator.
How do you know when to use a subquery in SQL?
SQL subquery is usually added in the WHERE Clause of the SQL statement. Most of the time, a subquery is used when you know how to search for a value using a SELECT statement, but do not know the exact value in the database.
Must Read
Is it good to use subquery in SQL?
Use subqueries when the result that you want requires more than one query and each subquery provides a subset of the table involved in the query. If a membership question is asked, then a subquery is usually used.