如何在同一网格视图中使用具有不同参数的同一表中的五个不同的SQl查询
select count(distinct callingnumber) as UniqueCaller,count(callingnumber) as numberOfCall from FCR1 where callnumberpercallreason >15;
select count(distinct callingnumber) as UniqueCaller,count(callingnumber) as numberOfCall from FCR1 where callnumberpercallreason between 2 and 6 and callreasonname='Mobile/GSM>VAS-CRBT>CRBT Service Deactivation';
=========output============
Calling frequency Unique Caller No of Call
15 7 116
B/n 14-11 11 133
B/n 10-8 50 412
B/n 7-2 8528 20635
One Times 46219 46219
Total 54815 67515
发布于 2014-04-23 00:01:39
如果您的列相同,则可以在两个查询之间使用union,如下所示:
select count(distinct callingnumber) as UniqueCaller,count(callingnumber) as numberOfCall from FCR1 where callnumberpercallreason >15;
union
select count(distinct callingnumber) as UniqueCaller,count(callingnumber) as numberOfCall from FCR1 where callnumberpercallreason between 2 and 6 and callreasonname='Mobile/GSM>VAS-CRBT>CRBT Service Deactivation';
如果您的列不同,则可以为不同的列创建空白,例如:
select col1, col2, col3 from table1
union
select col1, '', col4 from table2
https://stackoverflow.com/questions/22962836
复制相似问题