I'm going through some old stored procedures at work and constantly come across
CASE MyColumn WHEN 'Y' THEN 'Yes' WHEN 'N' THEN 'No' ELSE 'Unknown' END
It gets even worse when this is tied not to a word, but instead a colour.
CASE MyColumn WHEN 'Y' THEN 'style="background-color:pink"' ELSE '' END
The reason this was done was for older ASP 1 pages where everything had to be done inline, but as it's such a large system it's impossible to keep up with updating all the pages.
Can anyone give any valid evidence that using a SQL query for conditional statements surpasses that in other languages such as C# or Java? Is this good practice for speed? Should the plain value be returned and the presentation layer decide what should be done?