SQL select statement filtering

Posted by cc0 on Stack Overflow See other posts from Stack Overflow or by cc0
Published on 2010-04-23T17:41:40Z Indexed on 2010/04/23 17:53 UTC
Read the original article Hit count: 413

Filed under:
|
|

Ok, so I'm trying to select an amount of rows from a column that holds the value 3, but only if there are no rows containing 10 or 4, if there are rows containing 10 or 4 I only want to show those.

What would be a good syntax to do that? So far I've been attempting a CASE WHEN statement, but I can't seem to figure it out.

Any help would be greatly appreciated.

(My database is in an MS SQL 2008 server)

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server