November 22nd, 2003, 09:02 AM
an IS IN clause?
Is there a keyword where i can do something like this:
SELECT m.name FROM members m, membernumbers q
WHERE m.number IS IN q.number
basically give all the names of members whose number is in the column in the second table?
If not i need some serious help please check out my other post entitled table of REFs from Nov 19th!
November 22nd, 2003, 09:09 AM
oh found it!
for anyone looking for it its just
eg SELECT m.name FROM members m, numbers n
WEHRE m.number IN n.num
November 22nd, 2003, 09:53 AM
FROM members m
, numbers n
WHERE m.number = n.num
November 22nd, 2003, 09:58 AM
Oh, the example was simplified.
I had a table of REFs and i wanted to see if a certain REF was in it, i couldn't use equals because it gave me an error saying single row subquery only or something like that...
It wouldn't work, but it does for IN
here's the statement...
SELECT s.stuid, s.name, s.age
FROM studentmembers s
WHERE REF(s) IN
(SELECT * FROM TABLE
WHERE id = 1));
It wouldn't work with equals, but it does with IN!