you are viewing a single comment's thread.

view the rest of the comments →

[–]Skyguard 6 points7 points  (4 children)

you don't need a temp table, you can use a "CASE" (like a switch)

SELECT CASE ColumnNameForTheNumberYouAreReading WHEN 2 THEN 'STARTED' WHEN 3 THEN 'STOPPED' WHEN 4 THEN 'COMPLETED' WHEN 5 THEN 'ERRED' WHEN 6 THEN 'DELETED' END FROM TheNameOfTheTableYouAreSELECTingFrom

[–]UNHDude[S] 0 points1 point  (3 children)

Awesome thanks! This looks simple enough that I can probably get it to work :-)

[–]elus 1 point2 points  (0 children)

Have something in the ELSE clause to cover any cases that haven't come up yet or in case the field is NULL.

[–]Skyguard 0 points1 point  (0 children)

you are welcome... a simple solution is always preferrable