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


Please Help Members By Posting Answers For Below Questions

What are commit and rollback in sql?

658


What is difference between materialized view and view?

597


How do I create a stored procedure in dbml?

605


How to use column default values in insert statements in ms sql server?

620


Can group functions be mixed with non-group selection fields in ms sql server?

620






What is the difference between set and select?

661


What are Row versions of DataRow?

697


Explain the difference between control flow and data flow?

612


What is the difference between delete and truncate statements?

647


How to create a new schema in a database?

642


What is left outer join in sql server joins?

628


What do you understand by mirroring?

660


Can binary strings be used in arithmetical operations?

604


Define a cross join?

679


What are the advantages of paper records?

648