24.11.2017 10:53, [email protected] wrote: > > I have a query with no results and I doo't understand what I do wrong: > > SELECT DENSUB, CODSUB from SUBANS,TEMPSUB > > WHERE SUBANS.CODSUB=TEMPSUB.CODSBB AND SUBANS.CODSUB NOT IN (SELECT > CODSBB FROM TEMPSUB) AND SUBANS.CODPF='FL1' order by SUBANS.DENSUB asc > > The query must return some values but, I don't get any errors nor results.
Does TEMPSUB.CODSBB contain any NULLs? If so, it forces NOT IN to always return false. Perhaps you need to use NOT EXISTS instead. Dmitry
