Re: [SQL] subselect and left join not working?

2010-11-29 Thread Jorge Arenas
000 but I am expecting those zonas that have no usr_folio assignated "A" 1002 "B" "C" 1003 "D" 1004 "DGO" "E" 1005 "F" 1006 "F VER" 1010 "FCOAH" "FCHIH" 1007 "FGRO" &qu

[SQL] subselect and left join not working?

2010-11-28 Thread Jorge Arenas
Hi, I am using postgres 8.4 and I am having problems doing a very simple query: select zona_id from zonas where zona_id not in (select zona_id from usuarios where per_id =2) but I get no records in return. The problem is that, if I I break down the quey, I get: select zona_id from zonas "