Oracle将查询的结果放入一张自定义表中并再查询数据

如下的实际例子代码可以将查询的结果放入到一张自定义表中,同时可以再从这个自定义的表中查询数据:

with aa as
(select ticketnumber, tickettype, versionnumber, stagename, dtanalyzed,
gisprocessid, processstatus, dtreceived, userid, username, firstname,
lastname, numberofdays
from report_performanceofanalyzer
where (dtanalyzed is null)
union all
select ticketnumber, tickettype, versionnumber, stagename, dtanalyzed,
gisprocessid, processstatus, dtreceived, userid, username, firstname,
lastname, numberofdays
from report_performanceofanalyzer report_performanceofanalyzer_1)
select ticketnumber, tickettype, versionnumber, stagename, dtanalyzed,
gisprocessid, processstatus, dtreceived, userid, username, firstname,
lastname, numberofdays,
(select count(gisprocessid) as counttickets from aa) counttickets
from aa
order by username;

(0)
上一篇 2022年3月22日
下一篇 2022年3月22日

相关推荐