I have a table Vulnerabilities from which I want to query records ordered by severity (column). Severity column holds value "High", "Medium","low".
The below given query is giving me error:
for SELECT DISTINCT, ORDER BY expressions must appear in select list"
SELECT DISTINCT vuln
FROM Vulnerabilities vuln
WHERE (lower(vuln.dsc) LIKE '%tomcat%')
ORDER BY CASE vuln.severity
WHEN 'High' THEN 1
WHEN 'Medium' THEN 2
WHEN 'Low' THEN 3
END ASC