Using CASE expression is multi-branch judgment.
SELECT id,
case when s.`name`='aa' then '男'
WHEN s.name='bb' THEN '女'
else null end
from school as s
Using CASE expression is multi-branch judgment.
SELECT id,
case when s.`name`='aa' then '男'
WHEN s.name='bb' THEN '女'
else null end
from school as s