SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Site Related Forums
 Article Discussion
 Using view instead of Subquery
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

funky
Starting Member

USA
1 Posts

Posted - 02/10/2014 :  02:26:07  Show Profile  Reply with Quote
Retrieve SSN and the last name of married female employees who work on three or more projects

/*SELECT E.SSN,E.LNAME FROM EMPLOYEE E, WORKS_ON W
WHERE E.SEX = 'F' AND E.SSN IN (SELECT D.ESSN FROM DEPENDENT D WHERE D.RELATIONSHIP = 'Spouse')
AND E.SSN = W.ESSN
GROUP BY E.SSN,E.LNAME HAVING COUNT(*) >= 3;*/

-----This query is working fine.



How do i Use VIEW instead of Subquery to express the above query ??
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000