回答:select * from table_name where ${if(len(查询字段input) == 0,"1=1",表单编号input)} ${if(len(条件符input) == 0,"",条件符input)} ${if(len(条件值input) == 0,"",条件值input)}参考一下
回答:select num,count(num)icount from(selectcase when job_group='221' then '党群现员'when job_group='221' and emp_state='111' then '党群在岗'when job_group='221' and emp_state='111' and gbgr_flag='02' then '党群干部'when job_group='221' and emp_state='111' and gbgr_flag='02' and stechnical_level is not null then '党群聘任专业资格'when job_group='221' and emp_state='111' and gbgr_flag='04' then '党群工人'end as 'num'from v_empwhere cmpany_id not in ('999900020009000314A6','999900020009000114B9') and office_name not in ('减少人员'))z group by num因为num是你自定义的,需要套一层才能引用!这个是根据你代码改的,参考一下。
2
2
1
10
没有更多