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 ')
);
SQL query, how to add a column