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
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
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
>
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
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
|
+--