Hey what can I use for the equivalent of Oracle's DECODE thru ODBC connecting to SQL Server??
Thanks, Frank R
What does decode do?
Decode allows you to compare a field in a select statement, and assigning it a temporary value.
decode(<fieldname>, <If it's this>, <Do This>)
SELECT Category = CASE type WHEN 'popular_comp' THEN 'Popular Computing' WHEN 'mod_cook' THEN 'Modern Cooking' WHEN 'business' THEN 'Business' WHEN 'psychology' THEN 'Psychology' WHEN 'trad_cook' THEN 'Traditional Cooking' ELSE 'Not yet categorized' END, CAST(title AS varchar(25)) AS 'Shortened Title', price AS Price FROM titles