|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today! |
|
#1
|
|||
|
|||
|
Query: Subtraction one set from another set in MySQL
Hi,
Does anyone know in MySQL, how to exclude one set of record from another set, which is similar to 'NOT IN' in some SQL language. e.g: select * from A where A.ID NOT IN ( select ID from Table B ) Thanks a lot. Roger |
|
#2
|
|||
|
|||
|
RE: Query: Subtraction one set from another set in MySQL
SELECT * FROM table1 WHERE id NOT IN (SELECT id FROM table2);
is equal to: SELECT table1.* FROM table1 LEFT JOIN table2 ON table1.id=table2.id WHERE table2.id IS NULL; |
|
#3
|
|||
|
|||
|
RE: Query: Subtraction one set from another set in MySQL
Hi,
Thank you for your reply. It works. Thanks. Roger |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > Query: Subtraction one set from another set in MySQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|