Jumat, 13 April 2012

Using a CASE statement in a SQL Server WHERE clause

I'm trying to change the WHERE clause depending how many persons that exist in each State or City. If there are more then 10 people in a state I want the WHERE to be: WHERE u.StateID = @StateID If there are more then 10 people in a city I want it to be: WHERE u.CityID = @CityID instead of WHERE u.StateID = @StateID If there aren't more then 10 people in either city or state I want

0 comments:

Posting Komentar