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
i have made a project i vb.net n created a .exe of it after installing it in to any pc, the database (sql express) is not geting accesed i.e the aplication cuts the link of the database, so plz help in this matter.
Can you always create a cache of a report?
Why we use trigger in sql server with example?
Do you know hot add cpu in sql server 2008?
Difference between Sql server reporting services and Crystal reports?
What is 1nf 2nf?
how to define testing of network layers? : Sql server database administration
What are the different Topologies in which Replication can be configured?
What stored by the model? : sql server database administration
How to write the storeprocedure with in the store procedure? and how can we write the store procedure with in a trigger vice versa? plz post me the exact answer?
What is the default value of an integer data type in sql server 2005?
How can i Relate Tables in SSIS
What is nolock hint in sql server 2008
What is acid properties?
What is the difference between varchar and nvarchar datatypes?