1

I am sure a very simple question for people out there but my brain has shutdown.

I have joined two tables with a left join which has worked as hoped as I do need to bring back the NULLs in one of the tables as some of the rows will not have cosponsoring matches.

I need to put a WHERE clause on one of the columns that 'Could' be NULL and I want to bring back all rows that have 0 and the NULLs

Simply put like this so I want to bring back on rows with 0 or the NULL / Blanks WHERE Expired = '0'

4

Depending on indexing and size of data, you may find performance is better if you use:

SELECT * FROM table WHERE (col = 0 OR col IS NULL)

Or

SELECT * FROM table WHERE col = 0

UNION ALL

SELECT * FROM table WHERE col IS NULL
0

Sorry for the time wasting, resolved it with a simple ISNULL, It's been a long week already.

AND ISNULL(VC.Expired,0) = '0'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.