Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering the results of one query for another

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have two tables one called suspend with a field called ChanName and another table called chanlist also with a field called ChanName. Basically I would like a query that will select everything from chanlist EXCEPT where a ChanName in suspend matches the ChanName suspend table.
Can anyone help me because this is making my head hurt :)
 
Why don't you just make a column in chanlist, that is called suspend.. and if the person or whatever is suspend, then insert a "y" into it..


Then you would have an easy query instead of doing a crazy one...

Code:
Select * from chanlist where suspend <> &quot;y&quot;
www.vzio.com
ASP WEB DEVELOPMENT



 
That would be inefficient and leave a lot of wasted space and unnecessary nulls.
Besides I need to store other information in the suspends table like who suspended it and why.
 
if I've got the requirement correct

What about:

SELECT * FROM chanlist
WHERE channame NOT IN
(SELECT channame FROM suspend) ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top