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
Name few of the dcl commands in sql?
What is explicit cursors?
What are the character string functions supported by sql server 2005?
What is the difference between varchar and nvarchar datatypes?
What is sql server query analyzer?
How to round a numeric value to a specific precision?
How can we use ConnectorJ JDBC Driver with MS SQL?
what are the new features in SSRS?
What is the difference between lock, block and deadlock? : sql server database administration
Can sql servers linked to other servers like oracle?
Why Master database is required?
What is xdr?
How can you list all the table constraints in a database?
What are the system database in sql server 2008?
1.what is the diff between nolock optimizer and read uncommitted isolation? 2.what is the diff between revoke and deny? 3.what is percieved down time? 4.whether password protection are required for backups?if yes why?if no why? 5.what is fill factor? 6.what is cost analysis? 7.what is mean by piece meal restore? 8.what is 'rowguidcol'? 9.impersonate permission? 10.what is selectivity?