How do I perform an IF...THEN in an SQL SELECT statement?
IF...THEN
SQL SELECT
For example:
SELECT IF(Obsolete = \'N\' OR InStock = \'Y\' ? 1 :
SELECT 1 AS Saleable, * FROM @Product WHERE ( Obsolete = 'N' OR InStock = 'Y' ) UNION SELECT 0 AS Saleable, * FROM @Product WHERE NOT ( Obsolete = 'N' OR InStock = 'Y' )