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 to attach adventureworkslt physical files to the server?

629


What is analysis service repository?

585


Explain four layers of abstraction microsoft architectured?

120


What is the use of attributehierarchyvisible ? : sql server analysis services, ssas

571


What is public role in sql server?

533






John exports information periodically from a microsoft sql server database to an oracle database what is the best way to do this?

527


What are commit and rollback in sql?

567


What is the difference between NOROW and LOCKROW?

2235


What is dbcc command in sql server?

584


How to use the inserted and deleted pseudo tables?

543


What is the use of for clause?

577


what is memory-optimized nonclustered indexes

557


What are the advantages of sql azure?

116


last function used in MS Access to convert sql what function will use in sql

1603


How to assign null values to variables or columns?

547