Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. DECLARE @QuerySelector int = 3;
  2. IF @QuerySelector = 1
  3. BEGIN
  4.     SELECT TOP 3 ProductID, Name, Color
  5.     FROM Production.Product
  6.     WHERE Color = 'Silver'
  7.     ORDER BY Name
  8. END
  9. ELSE
  10. BEGIN
  11.     SELECT TOP 3 ProductID, Name, Color
  12.     FROM Production.Product
  13.     WHERE Color = 'Black'
  14.     ORDER BY Name
  15. END;