For the following SQL query:
SELECT `bh`.`bug_id`, `p`.`name` AS `project`, `p2`.`name` AS `portfolio`, `u`.`username` AS `user`,FROM_UNIXTIME( `bh`.`date_modified` ) AS `modify_ts`,
`b`.`severity`, `b`.`priority`, `b`.`resolution`, `b`.`Status`
FROM `bug`.`mantis_bug_history_table` AS `bh`
LEFT JOIN `bug`.`mantis_bug_table` `b` ON `bh`.`bug_id` = `b`.`id`
LEFT JOIN `bug`.`mantis_user_table` `u` ON `bh`.`user_id` = `u`.`id`
LEFT JOIN `bug`.`mantis_project_table` `p` ON `b`.`project_id` = `p`.`id`
LEFT JOIN `bug`.`mantis_project_hierarchy_table` `ph` ON `b`.`project_id` = `ph`.`child_id`
LEFT JOIN `bug`.`mantis_project_table` `p2` ON `ph`.`parent_id` = `p2`.`id`
WHERE `bh`.`field_name` = "status"
AND `bh`.`old_value` = 80
AND `bh`.`new_value` = 50
I want to return the value of the "b
.severity
, b
.priority
" as names. So currently they will return a value such as 20,40,60 for severity and priority would have the values 30,60,90. What I want to do is say if the severity value = 20 then call it sev1, 40 then call it sev 2 and similarly the same for priorities.
How would I go about making that change within the query above?
Thanks very much for any help