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 skip remaining statements in a loop block using continue statements?

535


what are defaults? Is there a column to which a default can't be bound? : Sql server database administration

614


What is the full form of ddl?

502


What is the difference between a "where" clause and a "having" clause?

608


How to connect Azure federated root database and apply federation in entity framework?

87






Which tcl commands are available on the sql server?

601


What is multilevel indexing?

527


How to end a stored procedure properly in ms sql server?

546


Explain error handling in ssis?

565


Show Practically Sql Server Views are updatable?

586


How to search for a string in all stored procedure in sql server?

530


Do you know sql server 2008 introduces automatic auditing?

511


you have separate development and production systems you want to move a copy of a development database into production to do this, you do a backup on the development system and restore to the production system after a few minutes, you begin getting calls from several customers saying that they are denied access to the system why? : Sql server administration

549


How is foreign key related to primary key?

568


Is oracle faster than sql server?

549