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 / jayesh sonawane
this one correct try it:
SELECT
distinct
B.NAMES AS NAMES
B.SID
,B.DEPT AS DEPARTMENT
,B.SALARY AS SALARY
,B.DESIGNATION AS DESIGNATION
FROM TABLEB AS A join TABLEB AS b
on A.EID=B.SID and B.DEPT=A.DEPT and B.SALARY=A.SALARY and B.DESIGNATION =A.DESIGNATION
join TABLEA as taba on ON A.taba =B.SID
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Will sql server 2005 allow you to reduce the size of a column?
Explain transaction server auto commit?
What are null values in ms sql server?
What are .mdf files?
What is dml command?
what is a self join? Explain it with an example? : Sql server database administration
How to truncate the log in sql server 2012? : sql server database administration
what's the information that can be stored inside a bit column? : Sql server database administration
What is the difference between NOROW and LOCKROW?
Do you know what are the steps to process a single select statement?
What is the guest user account in sql server? What login is it mapped to it? : sql server security
How to view existing indexes on an given table using sp_help?
What is scd (slowly changing dimension)? : sql server analysis services, ssas
Explain the dirty pages?
What protocol does sql server use?