Questo proposto da Piero.mac lo potresti anche fare con un'unica query:Originariamente inviato da piero.mac
bohhh.... fai due query:
select id from tabella where SOP > 0
metti gli id in una variabile separati da una virgola e poi li passi alla query seguente con NOT IN
select *
from tabella
where id NOT IN($var_id)
select *
from tabella
where id NOT IN (select id from tabella where SOP > 0)
Se dà errore, prova:
select B.*
from tabella as B
where B.id NOT IN (select A.id from tabella as A where A.SOP > 0)