Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (55.6k points)

Can anyone explain the sub query in SQL?

1 Answer

0 votes
by (119k points)

The subquery is the inner query of the nested query. The outer query in the nested query uses the output from the subquery. We can use a subquery in where clause of select, insert, update, and delete statements.

Here is a syntax to write subquery in SQL:

SELECT ColumnName

FROM TableName

WHERE ColumnName operator

                (Select ColumnName from TableName where condition);

You can check out this SQL tutorial blog by Intellipaat to learn writing complex subqueries in SQL.

Related questions

+3 votes
1 answer
asked Jul 3, 2019 in SQL by Tech4ever (20.3k points)
0 votes
1 answer
asked Oct 19, 2020 in SQL by dev_sk2311 (45k points)
0 votes
1 answer
0 votes
1 answer
asked May 5, 2020 in SQL by Sudhir_1997 (55.6k points)
0 votes
1 answer
asked Sep 14, 2020 in SQL by Sudhir_1997 (55.6k points)

Browse Categories

...