Re: Select member when it meets two requirements

2004-11-30 Thread Michael Stassen
CTED] Subject: Re: Select member when it meets two requirements Hi Mike, you should be able to do: SELECT DISTINCT t.member_id FROM table t INNER JOIN table t2 ON t2.member_id = t.member_id AND t2.speciality_id = 2 WHERE t.speciality_id = 6 /Johan Mike Zornek wrote: I'm very much a noob when it

Re: Select member when it meets two requirements

2004-11-30 Thread Roger Baklund
Graham Cossey wrote: Am I missing something? Will this not do the trick: SELECT DISTINCT member_id FROM table WHERE specialty_id IN(6,33); That would return any member_id with specialty_id=6 and any member_id with specialty_id=33, i.e. member_ids with specialty_id 6 OR 33. I think he wanted membe

RE: Select member when it meets two requirements

2004-11-30 Thread Graham Cossey
ubject: Re: Select member when it meets two requirements > > > Hi Mike, > you should be able to do: > > SELECT DISTINCT t.member_id > FROM table t > INNER JOIN table t2 ON t2.member_id = t.member_id AND t2.speciality_id = 2 > WHERE t.speciality_id = 6 > > /Johan >

Re: Select member when it meets two requirements

2004-11-30 Thread Johan Höök
Hi Mike, you should be able to do: SELECT DISTINCT t.member_id FROM table t INNER JOIN table t2 ON t2.member_id = t.member_id AND t2.speciality_id = 2 WHERE t.speciality_id = 6 /Johan Mike Zornek wrote: I'm very much a noob when it comes to MySQL .. Historically I've only used it for storage. I nee

Select member when it meets two requirements

2004-11-30 Thread Mike Zornek
I'm very much a noob when it comes to MySQL .. Historically I've only used it for storage. I need help. I have a table: ++---+--+-+-+--- -+ | Field | Type | Null | Key | Default | Extra | +--