您的位置:首页 > 数据库

sql查询,如何增加一列

2014-12-25 13:52 302 查看
select * from (
select 'finish_order_info' as table_name,count(1)as num from fraudorder.finish_order_info where crt_dt between to_date('2014-12-24:00:00:00','yyyy-mm-dd,hh24:mi:ss') and to_date('2014-12-25:00:00:00') group by 'finish' union all
select 'discard_order_info' as table_name, count(1)as num from FRAUDORDER.discard_order_info where crt_dt between to_date('2014-12-24:00:00:00','yyyy-mm-dd,hh24:mi:ss') and to_date('2014-12-25:00:00:00')union all
select 'raw_air_order_info' as table_name, count(1)as num from FRAUDORDER.raw_air_order_info where crt_dt between to_date('2014-12-24:00:00:00','yyyy-mm-dd,hh24:mi:ss') and to_date('2014-12-25:00:00:00')union all
select 'app_air_order_info' as table_name, count(1)as num from FRAUDORDER.app_air_order_info where crt_dt between to_date('2014-12-24:00:00:00','yyyy-mm-dd,hh24:mi:ss') and to_date('2014-12-25:00:00:00')union all
select 'unkown_order_info' as table_name, count(1)as num from FRAUDORDER.unkown_order_info where crt_dt between to_date('2014-12-24:00:00:00','yyyy-mm-dd,hh24:mi:ss') and to_date('2014-12-25:00:00:00')
);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: