List:MySQL on Win32« Previous MessageNext Message »
From:Antonio Navarro Navarro Date:August 31 1999 8:45am
Subject:Missing subquery problem
View as plain text  
Hello !!

I have two databases, one of them with companies and the other with activity codes. The
same company (say code 0001) could have several entries in the activity code table (0001
- 1.1, 0001 - 1.2, etc...).

I have to do a query for retrieving the companies that have two activities codes, in this
way:

  Companies table          Activities table
--------------------    ---------------------
Code   Name              Code     Activity
--------------------    ---------------------
0001   AAAAAAAAAAAA      0001     1.1
0002   BBBBBBBBBBBB      0001     2.2
0003   CCCCCCCCCCCC      0002     1.1
0004   DDDDDDDDDDDD      0003     2.2
                         0004     2.2
                         0004     1.1

I want to retrieve the companies that have Activity 1.1 AND 2.2 (Companies code 0001 and
0004) but I can't figure how to do it without using nested selects.

Help me please !


Antonio Navarro Navarro
BemarNet Management
http://www.bemarnet.es
hostmaster@stripped
Tel. +34-96-1656644
Fax. +34-96-1656514
Thread
Missing subquery problemAntonio Navarro Navarro31 Aug
  • Re: Missing subquery problemThomas Bouton31 Aug
    • Re: Missing subquery problemAntonio Navarro Navarro31 Aug