select 语句作为临时表

select * from(
select sum(settle_num),rtrim(ins_id_cd) ins_id_cd
from tbl group by ins_id_cd
) as tmp
where ins_id_cd='11111'

必须有as tmp
通过rtrim(ins_id_cd) ins_id_cd增加一个别名

你可能感兴趣的:(select 语句作为临时表)