0 votes
1 view
in SQL by (53.7k points)

Can anyone explain the sub query in SQL?

1 Answer

0 votes
by (116k 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
3 answers
asked Jul 3, 2019 in SQL by Tech4ever (20.3k points)
0 votes
1 answer
asked Oct 19, 2020 in SQL by dev_sk2311 (31.8k points)
0 votes
1 answer
0 votes
1 answer
asked May 5, 2020 in SQL by Sudhir_1997 (53.7k points)
0 votes
1 answer
asked Sep 14, 2020 in SQL by Sudhir_1997 (53.7k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...