Re: [GENERAL] What is the difference between these queries

2011-04-12 Thread tv
> t...@fuzzy.cz writes: >>> Query1 >>> -- the first select return 10 rows >>> SELECT a, b >>> FROM table1 LEFT JOIN table2 on (table1_id = tabl2_id) >>> Where table1_id NOT IN (SELECT DISTINCT table1_id FROM table3) >>> EXCEPT >>> -- this select return 5 rows >>> SELECT a, b >>> FROM table1 LEFT JO

Re: [GENERAL] What is the difference between these queries

2011-04-12 Thread Tom Lane
t...@fuzzy.cz writes: >> Query1 >> -- the first select return 10 rows >> SELECT a, b >> FROM table1 LEFT JOIN table2 on (table1_id = tabl2_id) >> Where table1_id NOT IN (SELECT DISTINCT table1_id FROM table3) >> EXCEPT >> -- this select return 5 rows >> SELECT a, b >> FROM table1 LEFT JOIN table2 o

Re: [GENERAL] What is the difference between these queries

2011-04-12 Thread tv
> > Query1 > -- the first select return 10 rows > SELECT a, b > FROM table1 LEFT JOIN table2 on (table1_id = tabl2_id) > Where table1_id NOT IN (SELECT DISTINCT table1_id FROM table3) > EXCEPT > -- this select return 5 rows > SELECT a, b > FROM table1 LEFT JOIN table2 on (table1_id = tabl2_id) > Wh