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 the current version of sql?
what is sql server agent? : Sql dba
Does group by remove duplicates?
how to start mysql server? : Sql dba
what is dbms? : Sql dba
What is the current version of postgresql?
What is the best sql course?
What is your daily office routine?
how many tables will create when we create table, what are they? : Sql dba
what is schema? : Sql dba
Is primary key always clustered index?
Is primary key clustered index?
How do I remove duplicates in two columns?
define sql insert statement ? : Sql dba
Can delete statement be rollbacked?