目录
数据库中 一个字段假设头像url
ifnull(字段值,"默认值")
( CASE WHEN au1.avatar_url IS NULL THEN 'img' ELSE 'img' END ) AS referreredUrl
else表示 上述条件不满足时 走else
- (
- CASE
- shop_type
- WHEN 0 THEN
- "结果值"
- WHEN 1 THEN
- "结果值"
- WHEN 2 THEN
- "结果值"
- WHEN 3 THEN
- "结果值"
- END
- ) AS shopTypeName