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 need help.

I have a table:

+--------------------+-----------------------+------+-----+---------+-------
---------+
| Field              | Type                  | Null | Key | Default | Extra
|
+--------------------+-----------------------+------+-----+---------+-------
---------+
| memberspecialty_id | int(10) unsigned      |      | PRI | NULL    |
auto_increment |
| member_id          | smallint(10) unsigned |      | MUL | 0       |
|
| specialty_id       | tinyint(3) unsigned   |      | MUL | 0       |
|
+--------------------+-----------------------+------+-----+---------+-------
---------+

How would I select all distinct member_id that have a specialty_id of 6 and
33?

Thanks!

~ Mike
-----
Mike Zornek
Web Designer, Media Developer, Programmer and Geek
Personal site: <http://MikeZornek.com>





-- Johan Höök, Pythagoras Engineering Group - MailTo:[EMAIL PROTECTED] - http://www.pythagoras.se Pythagoras AB, Stormbyv. 2-4, SE-163 55 SPÅNGA, Sweden Phone: +46 8 760 00 10 Fax: +46 8 761 22 77


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to