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.
Author |
Topic |
glda19
Starting Member
3 Posts |
Posted - 2015-05-03 : 04:36:58
|
Hii have a column with a number of dogs in it.now on the basis of a parameterwhen the parameter is 0then i want to find only the numer of dogs =0if the parameter =1 then i whant to find only the number of dogs >=1how can i do that whit a where statement |
|
Kristen
Test
22859 Posts |
Posted - 2015-05-03 : 08:35:09
|
[code]WHERE (@MyDogs = 0 AND NumberOfDogs = 0) OR (@MyDogs = 1 AND NumberOfDogs >= 1)[/code] |
|
|
|
|
|