Dooling Posted June 12, 2008 Report Share Posted June 12, 2008 (edited) Labvakar! Jautājums kā optimālāk būtu atlasīt ierakstus no divām tabulām. Tabula 1 ID|Lauks 1|teksts 2|teksts 3|teksts 4|teksts 5|teksts Tabula 2 ID|Lauks 2|teksts 3|teksts 4|teksts Respektīvi man vajag atlasīt ID no tabulas 1, kuri nav tabulā 2. Edited June 12, 2008 by Dooling Link to comment Share on other sites More sharing options...
cilveks Posted June 12, 2008 Report Share Posted June 12, 2008 SELECT id FROM tab1 EXCEPT SELECT id FROM tab2; Link to comment Share on other sites More sharing options...
Toms Posted June 13, 2008 Report Share Posted June 13, 2008 Labaak bez subquery! SELECT t1.id,t1.lauks FROM t1,t2 WHERE t1.id != t2.id Link to comment Share on other sites More sharing options...
Recommended Posts