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
What is procedure function?
What is cost in sql execution plan?
How many commands are there in sql?
List the different type of joins?
how many values can the set function of mysql take? : Sql dba
Is sql free?
What is mutating error?
Can dml statements be used in pl/sql?
What is the difference between clustered and non-clustered index in sql?
What is clause in sql?
what is cursor and its type, what is ref cursor write a syntax to pass ref cursor into procedure out fucntion and call the procedure
When should I use nosql database?
What are the parameter modes supported by pl/sql?
Can sql function call stored procedure?
How can I change database name in sql?