我有這個簡單的查詢,它適用於mysql, 完美,但是當我對ORACLE執行它時,我只得到一個異常。Oracle Sql如何使用HAVING GROUP BY?
SELECT
EMPLOYEE_NO, sum(`END` - `START`) as cnt
FROM
EMPLOYEES
group by EMPLOYEE_NO
having cnt > 100;
架構
+---------------------+------------------+------+-----+
| Field | Type | Null | Key |
+---------------------+------------------+------+-----+
| EMPLOYEE_NO | int(10) unsigned | NO | PRI |
| START | date | NO | |
| END | date | NO | |
+---------------------+------------------+------+-----+
請閱讀[**如何問**](http://stackoverflow.com/help/how-to-ask) \t \t \t和[**如何創建一個最小的,完整的,並且可驗證的例子。**](http://stackoverflow.com/help/mcve)你有什麼錯誤? –
告訴我們你得到什麼錯誤,一開始;並且還顯示Oracle表的定義,而不是MySQL的定義? –