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

2010-11-29 Thread Jorge Arenas
Tom, The subselect worked when I removed nulls. Thanks! Now I am facing a similar problem with the left join: select zonas.zona_id from zonas order by zona_id "A" "B" "C" "D" "DGO" "E" "F" "F VER" "FCOAH" "FCHIH" "FGRO" "FGTO" "FHGO" "FPUE" "FQRO" "FQROO" "FSLP" "FYUC" "JAL" "MOR" "T" "x" selec

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

2010-11-29 Thread Tom Lane
Jasen Betts writes: > On 2010-11-29, Jorge Arenas wrote: >> select zona_id from zonas where zona_id not in (select zona_id from usuarios > ### ###### >> where per_id =2) > select 'FRED' from from usuarios where per_id =2 > what'shappening

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

2010-11-29 Thread Jasen Betts
On 2010-11-29, Jorge Arenas wrote: > select zona_id from zonas where zona_id not in (select zona_id from usuarios ### ###### > where per_id =2) select 'FRED' from from usuarios where per_id =2 what'shappening is your not in subquery is be