2012-02-21 65 views
-1

當我運行這段代碼顯示了一個錯誤天花板:無效的標識,請幫我在這裏找到Diff_In_Secs的天花板..如何在這裏使用天花板?

select a.action, CEILING(avg(extract(minute from b.RECEIVED_TS - a.RECEIVED_TS)*60 
    + extract(second from b.RECEIVED_TS - a.RECEIVED_TS))) Diff_In_Secs 
    from request a, reply b where a.ID = b.ID 
and a.RECEIVED_TS > trunc(sysdate) - 10 
and b.TARGET_ID is not null 
group by a.ACTION 
order by diff_in_secs desc; 
+0

你是什麼意思的「如何申請」?當您嘗試運行上述查詢時會發生什麼? – 2012-02-21 12:54:53

回答

1

這是你想要的嗎?

select a.action, CEILING(CEILING(avg(extract(minute from b.RECEIVED_TS - a.RECEIVED_TS)*60 
    + extract(second from b.RECEIVED_TS - a.RECEIVED_TS)))) Diff_In_Secs 
0

老問題,但我遇到了同樣的問題......在我的情況下,它不喜歡CEILING;使用CEIL來使它工作。