mysql中函数find_in_set可以对字符串在某个字段中是否存在,如果存在则返回含有该查询项的所有记录
SELECT
count(1)
FROM
contingency_plan_team_role
WHERE
find_in_set( 36, preview_task_ids);
查询结果:
case when 进行分组判断
case when release_time IS NOT NULL and `status`=0 then 4
when release_time IS NOT NULL and `status`=2 then 5
when release_time IS NOT NULL and `status`=3 then 6
else `status`
end as STATUS
case when的语法规则为
case when 条件 then 结果
when 条件 then 结果
when 条件 then 结果
else 结果
end as 别名