bitscn.com
mysql 做的demo
注意事项: mysql union 和 group 碰头 报错 双方要有括号
not in 和 limit 也要分开
(select app_type_id,
app_type_name
from `app_dw`.`app_type` #table_name
order by app_type_id
limit 5)
union all
(select sum(app_type_id) app_type_id,'the_six'
from `app_dw`.`app_type`
where app_type_key not in ( select * from
(select app_type_key from `app_dw`.`app_type`
order by app_type_id limit 5)as t)
)
bitscn.com