I have three dropdown boxes, Region, District, and City. I want my District dropdown to have a "Select All" option so the user can get all Cities in the Region, else just display the City based on the selected District. My query looks like this:
IF @district =-2 THEN 
(SELECT DISTINCT city
FROM myTable
WHERE  RIGHT(Region, 3) = ?)
ORDER BY city) 
ELSE 
(select DISTINCT city
  FROM myTable WHERE District = ?)
Order by city
I'm using vb.net/sql I couldn't find any complex case scenarios in my search either. Any sugguestions would be appreciated!