Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combine null and other selection in Where clause

Status
Not open for further replies.

drallabs

Technical User
Mar 2, 2006
28
US
I have a where clause looking for blanks and nulls in a column e.g.,

where column is null and column = ''

Is there a way to combine these into one where statement? I am looking for either or.
 
You want or? Then use or.

where column is null or column = ''
 
ShankarJ,

The code posted by ESquared is better to use. Let me explain.

If there is an index on the column, your query will not be able to use it, but the code posted by ESquared will. For a full explanation, do some reading about [google]SQL Server Sargable Query[/google].



-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top