So I have a query that looks something like this:
SELECT IncidentNumber,
ToiletType,
ToiletDangers,
IncidentDate
FROM Core.LostLawsuits
...which returns the following results sort of like this:
+----------------+------------+---------------------------+---------------+
| IncidentNumber | ToiletType | ToiletDangers | Incident Date |
+----------------+------------+---------------------------+---------------+
| 2100 | A | Spontaneous Combustion | 2/1/2016 |
+----------------+------------+---------------------------+---------------+
| 2101 | P | Attracts Bear Stampede | 2/1/2016 |
+----------------+------------+---------------------------+---------------+
What I'd like to do is get the results, but change the ToiletType column result when outputting it. Currently, I am using a nested REPLACE(), and would like to know if there's a better / different way of doing this, while maintaining a one column result for ToiletType:
SELECT IncidentNumber,
REPLACE(REPLACE(ToiletType, 'A', 'Automatic Standard'), 'P', 'Portable Potty') as ToiletType,
ToiletDangers,
IncidentDate
FROM Core.LostLawsuits