combining multiple queries into one

chadb

Registered User.
Local time
Yesterday, 21:27
Joined
Dec 13, 2005
Messages
18
How does one combine a query of a query into one query. I have some complex queries that query a query because I don't know how to do the same task in one query.

For example, let's say I have a table with EMPLOYEE, DAY, HOURS. I want to pull ALL the data for those employees that work on saturday. That means if they work monday, tuesday, saturday then all of their data will show up. How do I accomplish that in one query?

Currently I do this with two queries:
query1: Select EMPLOYEE from table where day = 'Saturday'
query2: I dont know the correct syntax on this one, but the gist is... using the table and query1 I join them so that everything from table shows that match query1.

Is it possible to do something along these lines:
select EMPLOYEE, DATE, HOURS from (select EMPLOYEE from Table where date = 'Saturday' inner join..blah blah)

The blah blah is whatever the correct innerjoin syntax is.

Thanks for your help.
 

Users who are viewing this thread

Back
Top Bottom