select case when max(replace(字段名,'$','')) = null then '0' else max(replace (字段名,'$','')) end 字段名 from (select 查询的一些字段 from 表名 ) t where 条件