Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 exclude data

Author  Topic 

peace
Constraint Violating Yak Guru

420 Posts

Posted - 2013-05-22 : 04:05:54
how can i exclude in this scenario?

case when date = 2013-01-01 then color which is blue will not be pull out..while other color will be pulled..

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-05-22 : 04:10:51
As per you explanation sounds like this

SELECT *
FROM Table
WHERE Color <> 'blue'
OR datefield <> '20130101'


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2013-05-22 : 04:17:10
Or the logical equivalent:

NOT ( Datefield = '20130101' AND Color = 'Blue' )


Transact Charlie
Msg 3903.. The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION.
http://nosqlsolution.blogspot.co.uk/
Go to Top of Page
   

- Advertisement -