1.盡量使用列名
2.where 解析順序 :右==>左
where condition1 and condition2 把結果最有可能為false的放在右面
where condition1 or and condition2 把結果最有可能為true的放在右面
3.盡量使用where,而不是having 因為 where是先過濾後分組,having是先分組後過濾
4.盡量使用多表查詢,而不是子查詢
因為子查詢會查詢兩次 而多表查詢隻查詢一次,而且oracle也是這樣做的,大部分情況下它在優化的時候就把自查詢轉化為多表查詢(分頁除外);

We only live once, and time just goes by.