Extras din documentatia de MySQL:

The queries:

SELECT * FROM table1 WHERE id NOT IN (SELECT id FROM table2);
SELECT * FROM table1 WHERE NOT EXISTS (SELECT id FROM table2 where
table1.id=table2.id); 

Can be rewritten as:
SELECT table1.* FROM table1 LEFT JOIN table2 ON table1.id=table2.id
where table2.id IS NULL

Alex wrote:
> 
> cum pot sa scriu in mysql un statement de genul:
> SELECT codice,codice_esterno,cognome,nome,cfisc_piva FROM anagrafica
> WHERE (codice<>ALL(SELECT codice_nominativo FROM dati_consenso)) ORDER BY cognome
> 
> Alex.

Deci cred ca ar trebui ceva de genul:

SELECT t1.* FROM anagrafica as t1 LEFT JOIN dati_consenso as t2 ON
t1.codice=t2.codice_nominativo WHERE t2.codice_nominativo IS NULL ORDER
BY t1.cognome

"Ho sparato anch'io al caso" but hope it helps ;)

Cristi
---
Pentru dezabonare, trimiteti mail la 
[EMAIL PROTECTED] cu subiectul 'unsubscribe rlug'.
REGULI, arhive si alte informatii: http://www.lug.ro/mlist/


Raspunde prin e-mail lui