亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 44860 | 回復(fù): 2
打印 上一主題 下一主題

union all語句簡(jiǎn)化問題 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2016-07-26 16:59 |只看該作者 |倒序?yàn)g覽
求大神支招,下面的多個(gè)union all語句如何簡(jiǎn)化?
里面查詢的是從201205到201607的日志表數(shù)據(jù)

with tb as(
select * from AOP_STAT_INVOKED_LOG_201205 t1 where t1.app_id=-1 and t1.ability_id<>-1 union all   
select * from AOP_STAT_INVOKED_LOG_201206 t2 where t2.app_id=-1 and t2.ability_id<>-1 union all
select * from AOP_STAT_INVOKED_LOG_201207 t3 where t3.app_id=-1 and t3.ability_id<>-1 union all
select * from AOP_STAT_INVOKED_LOG_201208 t1 where t1.app_id=-1 and t1.ability_id<>-1 union all   
select * from AOP_STAT_INVOKED_LOG_201209 t2 where t2.app_id=-1 and t2.ability_id<>-1 union all
select * from AOP_STAT_INVOKED_LOG_201210 t3 where t3.app_id=-1 and t3.ability_id<>-1 union all
select * from AOP_STAT_INVOKED_LOG_201211 t1 where t1.app_id=-1 and t1.ability_id<>-1 union all   
select * from AOP_STAT_INVOKED_LOG_201212 t2 where t2.app_id=-1 and t2.ability_id<>-1 union all
...
select * from AOP_STAT_INVOKED_LOG_201607 t3 where t3.app_id=-1 and t3.ability_id<>-1 )  
select tb.ability_id,tc.ability_name,sum(tb.invoked_nums) from tb,aop_ability_baseinfo tc where tb.ability_id=tc.ability_id group by tb.ability_id,tc.ability_name order by 3 desc;  

論壇徽章:
93
2015年辭舊歲徽章
日期:2019-10-10 10:51:15CU大;照
日期:2014-02-21 14:21:56CU十二周年紀(jì)念徽章
日期:2020-10-15 16:55:55CU大牛徽章
日期:2014-02-21 14:22:07羊年新春福章
日期:2019-10-10 10:51:39CU大牛徽章
日期:2019-10-10 10:55:38季節(jié)之章:春
日期:2020-10-15 16:57:40ChinaUnix元老
日期:2019-10-10 10:54:42季節(jié)之章:冬
日期:2019-10-10 10:57:17CU大;照
日期:2014-02-21 14:22:52CU大;照
日期:2014-03-13 10:40:30CU大;照
日期:2014-02-21 14:23:15
2 [報(bào)告]
發(fā)表于 2016-07-27 09:55 |只看該作者
多個(gè)不同表的查詢沒什么想法,我也是這樣做,坐看高手怎么處理的學(xué)一下。

求職 : Linux運(yùn)維
論壇徽章:
203
拜羊年徽章
日期:2015-03-03 16:15:432015年辭舊歲徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:57:092015小元宵徽章
日期:2015-03-06 15:58:182015年亞洲杯之約旦
日期:2015-04-05 20:08:292015年亞洲杯之澳大利亞
日期:2015-04-09 09:25:552015年亞洲杯之約旦
日期:2015-04-10 17:34:102015年亞洲杯之巴勒斯坦
日期:2015-04-10 17:35:342015年亞洲杯之日本
日期:2015-04-16 16:28:552015年亞洲杯紀(jì)念徽章
日期:2015-04-27 23:29:17操作系統(tǒng)版塊每日發(fā)帖之星
日期:2015-06-06 22:20:00操作系統(tǒng)版塊每日發(fā)帖之星
日期:2015-06-09 22:20:00
3 [報(bào)告]
發(fā)表于 2016-07-29 15:52 |只看該作者
肯定不是mysql,mysql沒有with tb as語法的
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP