Home » RDBMS Server » Server Administration » SUBQUERY
SUBQUERY [message #372994] Wed, 21 March 2001 11:42 Go to next message
II
Messages: 1
Registered: March 2001
Junior Member
WHAT IS THE DIFFERENT BETWEEN SIMPLE SUBQUERY,COMPLEX SUBQUERY,AND CO-RELATED SUBQUERY?
THANKS!
Re: SUBQUERY [message #373033 is a reply to message #372994] Fri, 23 March 2001 11:40 Go to previous message
ramu
Messages: 82
Registered: February 2001
Member
Simple subquery is one the sub query used to filter the main query..

For example:

SELECT *FROM EMP WHERE DEPTNO=(SELECT DEPTNO FROM DEPT WHERE DNAME='ACCOUNTS';

Here to select all the values from emp the condition Deptno having the values filtered from the DEPT table;

Complex Subquery may be like the subquery again use the filtering condition..

Corelated subquery is one that the subquery refers to main..

For example:

SELECT SAL FROM EMP X WHERE &N=(SELECT COUNT(SAL) FROM EMP WHERE SAL>=X.SAL)

Here the main query has a reference in the subquery..

I have only this idea.. If any one give suggession I will accept that..

Thanks..

Ramu..
Previous Topic: Deleting Tables
Next Topic: sql script help !!!
Goto Forum:
  


Current Time: Wed Jun 26 06:52:42 CDT 2024