Hello group!

I'm using MySQL 3.23.47 and I got this question.

I have got two tables which share a same field -> somewhat one is a foreign key of 
another.
Values of the field in one table are a subset of values of the same field of the other.

Ex
TABLE A
ID       Name Information       
1
.
.
.
100

TABLE B
ID      Relationships
1
.
.
.
10

For extracting NAME and INFORMATION from TABLE B ID entries, I perform a simple JOIN:

SELECT TableA.* from TableA, TableB where TableA.ID = TableB.ID

But if I do want to extract NAME and INFORMATION from TABLE A ID entries not common 
with TABLE B ID (11..100), I got no easy alternative...

I could make a first select on TABLE B and then many selects to all entries which are 
not included in retrieved TABLE ID.
I think that it is equivalent to a SUBSELECT in other DBMS (in MySQL 4.x is available, 
isn't it?)

So, is there any simple alternative without having to make 'such many queries (or 
looping thru' my interface prog language)' as implied in first possibility, or  is 
there no other option than moving to MySQL 4?

Thanks!
-- 
Toni Hermoso Pulido
------------------------------------------------------
web: http://www.arrakis.es/~toniher
email: [EMAIL PROTECTED]
       [EMAIL PROTECTED]

pgp_public_key: 
http://www.arrakis.es/~toniher/toniher.pgp
        
        *** Cífratelo, cífraselo ***
------------------------------------------------------

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to