Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I have two table emptable1(empid,status) emptable2(empid,week)
i want to select all the empid whose status is 0 in emptable1 and from that list of empid i need to select empid whose week is 7 from the table emptable2
Please help :-)
Not knowing your table structure in detail, but this ought to work:
SELECT (fields) FROM dbo.emptable1 e1 INNER JOIN dbo.emptable2 e2 ON e1.empid = e2.empid WHERE e1.status = 0 AND e2.week = 7
Add a comment
How about using join? Join the two, then do your logic implementation altogether.
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.