SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Probl using and / or
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jun0
Starting Member

United Kingdom
32 Posts

Posted - 03/13/2013 :  09:51:37  Show Profile  Reply with Quote
Hi Im doing a selet on a table, and the where clause looks like this:

where pmobject = 'object 1' and
'column 1' is not null or
'column 2' is not null or
'column 3' is not null or
'column 4' is not null


However this returns incorrect results because in the pmobject field I still get pmobjects other than 'object 1' in the results

There is something easy I'm missing, wondered if you guys could point me at it?

Thanks

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 03/13/2013 :  10:17:28  Show Profile  Reply with Quote

....
where pmobject = 'object 1' and
('column 1' is not null or
'column 2' is not null or
'column 3' is not null or
'column 4' is not null)



------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.07 seconds. Powered By: Snitz Forums 2000