Group Functions

Posted on 2009-09-28 13:37  Metisria Geo  阅读(304)  评论(0)    收藏  举报

•Syntax

image

•Group functions:

–Use AVG, SUM, MIN, MAX, COUNT

–Use DISTINCT keyword within group functions

NULL values in a group function

•Grouping rows:

GROUP BY clause

HAVING clause

Notice:

All columns in the SELECT list that are not in an aggregate function must be in the GROUP BY clause, but the GROUP BY column does not have to be in the SELECT list.

image image  image 

Can’t use the WHERE clause to restrict groups, but use the HAVING clause to restrict groups.

image
image

the example is oracle default instance: ORCL, unlock the user HR.

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3