I don't understand what is going on. I run this query and I get all records that are null? So is it checking the first OR clause and then stopping.
SELECT item_descr from mydb.mytable WHERE
substr(filename,5,3) = 052 OR substr(filename,5,3) = 060 AND item_descr IS NOT NULL
What I want is to find all the rows where there is something in the item_descr field
in the rows that are for filename 052 or 060.
To make it more complicated there are also filenames that are different.
OR substr(filename,1,6)='SUBJOB' AND (substr(filename,8,3)='060' ) ) OR
(substr(filename,1,3)='NOF' AND (substr(filename,5,3)='060' ) )
I would like to check if there is an item_descr in those rows also but I could run the above one at a time for the subjob and nof.
thanks,