Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 is data abstraction in sql?

1011


How do you create a db file?

997


Which is faster truncate or drop?

1030


What is an implicit commit?

1038


What is difference sql and mysql?

966


What are the parts of a sql statement?

1072


What is difference between rank () row_number () and dense_rank () in sql?

1090


Determine if oracle date is on a weekend?

1026


What is partition by in sql?

1049


what is sql server agent? : Sql dba

1082


What is a .db file?

961


What is trigger in flip flop?

1001


what is a constraint? Tell me about its various levels. : Sql dba

969


What company owns postgresql?

1006


What type of database is cloud sql?

1084