Zkuste toto:
SELECT id,
reason
CASE
WHEN reason = 'NoAnswer' THEN NoAnswer
WHEN reason = 'NetworkBusy' THEN NetworkBusy
END AS value
FROM table1
Měl by vám poskytnout výstup jako tento:
+----+------------+----------+
| id | reason | value |
+----+------------+----------+
| 1 | NoAnswer | 2 |
+----+------------+----------+