case association table query

select
a.employee number,b.`name`,b.`address`,
case
when a.income is null then 'no money'
when a.income< 2000 then 'low income'
when a.income>=2000 and income <=3000 then 'middle income'
else 'high income'
end as 'income level'
from salary a,employees b where a.employee number=b.employee number

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325482441&siteId=291194637