need a quick assist for some sql.... MSSQL
Posted: Wed Jun 28, 2006 5:00 pm
my brain is half-dead today and I can't wrap my head around this:
I need to select members based on capabilities from another table.
the capabilities table is very poorly structured, but nothing I can do about it now.
it looks something like this:
I need to perform a query to determine if certain members have rows in the table for 'aluminum' AND 'steel'.
doing something like this won't work....
...for obvious reasons.
I'd like to do this without a subquery if possible.
I need to select members based on capabilities from another table.
the capabilities table is very poorly structured, but nothing I can do about it now.
it looks something like this:
Code: Select all
substrate slitting sheeting painting memID
--------- --------- ----------- ----------- --------
aluminum 1 1 1 32
steel 0 0 0 32doing something like this won't work....
Code: Select all
SELECT m.* FROM members m, capabilities c WHERE m.id = c.memID AND (c.substrate = 'aluminum' AND c.substrate = 'steel')I'd like to do this without a subquery if possible.