Click to See Complete Forum and Search --> : Must be missing something


CrazyMerlin
01-10-2006, 06:54 PM
Am I asking for something wrong here.....


SELECT advisors.name FROM advisors WHERE advisors.advisor_id = (SELECT available.advisor_id FROM available WHERE available.status = yes))


what I want to do is display a list of available advisors.

It should return simply an advisors name.

Thx, it's late in the day and I'm tired....lol

chrismartz
01-10-2006, 07:47 PM
try
SELECT DISTINCT advisors.name FROM advisors WHERE advisors.advisor_id IN (SELECT available.advisor_id FROM available WHERE available.status = yes)

CrazyMerlin
01-11-2006, 12:37 AM
Thanks Chris, works a treat!

If toast always lands butter-side down, and cats always land on their feet, what happens if you strap toast on the back of a cat and drop it?

...the cats spins around and licks the butter off the toast

chrismartz
01-11-2006, 09:33 AM
No problem. Just remember that if you have a list of items your selecting from, use IN instead of =.