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...

Their are two tables 'A' and'B'.Table 'A' contains 3 columns
named 'eid','ename','dept'.
Table 'B'contains 3 columns
named'sid','designation','salary'.
We have to retrieve the names of employees working in the
same department,same designation and same salary.
Its urgent can anyone help me out in this problem.

Answer Posted / patan

WE HAVE TABLE A (EID,ENAME,DEPT) AND TABLE B (NAMED,SID,DESIGNATION,SALARY)

--WE WANT TO RETRIEVE FOLLOWING
SELECT
B.NAMES AS NAMES
,B.DEPT AS DEPARTMENT
,B.SALARY AS SALARY
,B.DESIGNATION AS DESIGNATION

FROM TABLEA AS A
LEFT JOIN TABLEB AS B
ON A.EID=B.SID
ORDER BY B.NAMED


NOTE:WHEN WE ARE USING LEFT JOIN IT WILL MATCH THE RECORDS FROM BOTH THE TABLES AND LEFT TABLE OF RECORDS WILL DISPLAY...THAT ONLY I DID HERE

TRY IT..SURE IT WILL USEFUL

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I debug a stored procedure in sql server?

1050


What to check if a User database is locked?

1033


If you're given a raw data table, how would perform etl (extract, transform, load) with sql to obtain the data in a desired format?

937


How to get a list of columns using the "sp_help" stored procedure in ms sql server?

1002


When should you use an instead of trigger?

936


Explain hostprotectionattribute in sql server 2005?

977


Is null in sql server?

962


optimization techinques

2648


When does a workload on SQL Azure get throttled?

129


what is the difference between them (ethernet networks and token ring networks)? : Sql server database administration

1006


How do I run a trace in sql server?

950


Explain the microsoft sql server delete command? : SQL Server Architecture

1034


How to view existing indexes on an given table using sys.indexes?

1064


What are alternate keys?

954


What is user defined datatypes and when you should go for them?

986