如何在oracle sql

时间:2016-04-06 18:51:49

标签: sql oracle

到目前为止,我做了类似的事情:

SELECT (EXTRACT(SECOND FROM (timeend  - timebeg))) AS diff 
FROM sometable HAVING diff > 5;

但它不能正常工作

2 个答案:

答案 0 :(得分:2)

请勿使用select

where子句的字段别名
SELECT EXTRACT(second FROM (timeend  - timebeg)) AS diff 
FROM sometable 
WHERE EXTRACT(second FROM (timeend  - timebeg))> 5;

答案 1 :(得分:0)

试试这个

Queue

这会在几秒钟内给出差异,您可以根据它进一步过滤您的查询。