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
What are information schema views?
When should you use an instead of trigger?
How do clustered indexes store data?
Where is my database stored on the hard disk in ms sql server?
Mention the uses of stored procedures.
How to optimize stored procedures in sql server?
Explain about extended stored procedure?
What is difference between global temporary tables and local temporary tables?
What is for xml in sql server?
Explain temporary table vs table variable by using cursor alternative?
Explain transaction server isolation?
List some major differences between triggers and stored procedures?
What is the New in SQL server 2008?
What is BLOCK statements in SQL?
What is sql server programming?