what is a nested subqueries in sql server

By j Miracle

here we see the use of the nested subqueries or how subquery works.

the nested subquery means the one query that will get the data using the another qurery in it.

for examlple:-
there is two table
(1) is 'borrower' and
(2) is 'depositor'

in which  you want to get the information about the custmer_name of the borrower who is also in the table depositor
there is need to write the subquery that is as follow

"select distinct custmer_name from borrower where custmer_name in(select custmer_name from depositor);"

in this query the query in the part of the where clause it's caled the subquery.

what is a nested subqueries in sql server  (988 Views)