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 :
Use CASE. Something like this.
SELECT Salable = CASE Obsolete WHEN 'N' THEN 1 ELSE 0 END