suppose I have two table one Emp and other is dpt.
Emp table has a field ,dept id,name ,sal and dpt table has a
field dept id,dept name.
Now I want to find out the emplyee list whose sal is between
2000-3000 from dept x.

Answer Posted / sravan

You can also solve it by using sub-query

SELECT DISTINCT NAME FROM EMP E
WHERE SAL>2000 AND SAL<3000
AND E.DEPTID IN (SELECT D.DEPTID FROM DPT D
WHERE DEPTNAME='X');

thanks

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you understand by exception handling in pl/sql?

569


Why are cursors used?

574


What is a sql instance vs database?

570


What is the difference between truncate and drop statements?

571


Explain the methods used to protect source code of pl/sql.

535






What do you mean by table in sql?

521


what are the security recommendations while using mysql? : Sql dba

572


What is a full join?

519


What does count (*) mean in sql?

1080


What is update query?

543


define sql update statement ? : Sql dba

561


Mention what does plv msg allows you to do?

662


How many triggers can be applied to a table?

592


How to test for null values?

598


What is a sql*loader control file?

611