Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Actually deptname is not available in emp table, that is the resion why i'm writing query by using join statement is it correct or not.....? Please replay me any bady knows.......?

QUERY:
SQL
SELECT DISTINCT(DNAME) FROM EMP INNER JOIN DEPT ON EMP.DEPTNO=DEPT.DEPTNO;
Posted
Updated 22-May-14 3:09am
v2
Comments
[no name] 22-May-14 9:00am    
Why are you screaming at people when asking them to help you?
_Asif_ 22-May-14 9:12am    
If DeptName is not available then what is DNAME? Why can't you do this? SELECT DNAME FROM DEPT?

1 solution

This query will give you a list of all departments that have employees in them.
If this is what you need, then it is correct.
 
Share this answer
 
Comments
MundazGun 11-Nov-14 2:16am    
Please complete your Question . I don't think you have phrased the question completely .

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900