比较复杂MYSQL语句

mysql 学习

select
concat(so1.object_name,‘/’,so.object_name),
so.object_id,
so.object_level,so.hidden_danger_level ,so.edit_type,
so.search_flag,so.spread_flag,so.photo_num,so.photo_flag,
so.multi_flag,so.sort,so. change_way,
case when find_in_set(so.object_id,(select group_concat(distinct object_ids) from safe_templet st
where st.tenant_id = ‘0A1501’ and templet_type = 1)) > 1 then ‘使用’ else ‘未使用’ end as ‘是否使用’
from safe_object so
inner join safe_object so1 on left(so.object_id,4) = so1.object_id and so.tenant_id = so1.tenant_id
where so.tenant_id = ‘0A1501’ and length(so.object_id) = 6 and so.state = 1;