Dec 22, 2006 #1 Naoise Programmer Dec 23, 2004 318 IE I have a large SELECT query along the lines of SELECT aa,bb,cc,dd,ee,ff,gg FROM tblA a INNER JOIN tblB b ON a.FldA = b.FldB .... WHERE a.FldA = 100 What is the best way of only selecting the values that are not NULL?
I have a large SELECT query along the lines of SELECT aa,bb,cc,dd,ee,ff,gg FROM tblA a INNER JOIN tblB b ON a.FldA = b.FldB .... WHERE a.FldA = 100 What is the best way of only selecting the values that are not NULL?
Dec 22, 2006 #2 JarlH Programmer Jul 26, 2002 365 SE Values that are not null, what do you mean? Do you mean you don't want to return any rows where one or more values are null? Then do something like WHERE aa IS NOT NULL AND bb IS NOT NULL... Or do you want to replace NULL with a specific value? The you can use COALESCE: SELECT COALESCE(aa,'Somthing instead of NULL'), COALESCE(bb,... Upvote 0 Downvote
Values that are not null, what do you mean? Do you mean you don't want to return any rows where one or more values are null? Then do something like WHERE aa IS NOT NULL AND bb IS NOT NULL... Or do you want to replace NULL with a specific value? The you can use COALESCE: SELECT COALESCE(aa,'Somthing instead of NULL'), COALESCE(bb,...