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

Does group by remove duplicates?

756


How do I install sql?

705


What is the maximum rows in csv?

661


How to add, remove, modify users using sql?

754


Are dml statements autocommit?

765


Is record in oracle pl sql?

704


What are the advantages of sql?

791


Is ms sql traffic encrypted?

688


What is mutating error in pl sql?

759


What is oracle pl sql developer?

718


How many sql core licenses do I need?

687


What is snowflake sql?

808


How to run sql statements with oracle sql developer?

802


What is the reports view in oracle sql developer?

732


What is an index in sql with example?

720