Clustering functions of Oracle SQL functions

Source: Internet
Author: User
Tags numeric value

AVG ([distinct|all]x) The "function" statistic table selects the average of row x columns. The "parameter" all means averaging all the values, distinct only the different values, the default is all if there is a parameter distinct or all, a space is separated from the X (column). "Parameter" x, only Numeric Field "return" Numeric Value "example" Environment: CREATE TABLE Table3 (XM varchar (8), Sal number (7,2) ; insert into table3 values ('Gao',1111.11) insert into table3 values ('Gao',1111.11) insert into table3 values ('Zhu',5555.55); commit; perform statistics:SelectAVG (DISTINCT sal), AVG (all Sal), avg (SAL) fromtable3; Results:3333.33  2592.59  2592.59SUM ([Distinct|all]x) The summary value of the row x column is selected in the function statistics table. The "parameter" all means that all values are summed, distinct only the different values, the default is all if there is a parameter distinct or all, a space is separated from the X (column). "Parameter" x, you can only perform statistics for numeric field "return" Numeric Value "Example":SelectSUM (distinct sal), sum (all Sal), sum (SAL) fromtable3; Results:6666.66     7777.77     7777.77STDDEV ([Distinct|all]x) The standard error of the row x column is selected in the function statistics table. The "parameter" all means that the standard error is calculated for all values, distinct only the standard error for the different values, and the default is all if there is a parameter distinct or all, a space is separated from the X (column). "Parameter" x, you can only perform statistics for numeric field "return" Numeric Value "Example":SelectSTDDEV (Distinct Sal), STDDEV (all Sal), STDDEV (SAL) fromtable3; Results:3142.69366257674     2565.99863039714  2565.99863039714Count (*| [distinct|all]x) The summary value of the row x column is selected in the function statistics table. "Parameters"*represents all row statistics that satisfy a condition, regardless of whether it repeats or has a null value (NULL) all means that all values are counted, the default is alldistinct only for different values, and if there are parameters distinct or all, spaces are separated by X (columns), and null values are ignored ( NULL). "Parameter" x, which can be a number, character, date, and other type of field "return" Numeric value count (*) =sum (1) "Example" Environment: CREATE TABLE Table3 (XM varchar (8), Sal number (7,2) ; insert into table3 values ('Gao',1111.11) insert into table3 values ('Gao',1111.11) insert into table3 values ('Zhu',5555.55) insert into table3 values ("',1111.11) insert into table3 values ('Zhu',0); commit; SQL>Select* fromTable3; XM SAL-------- ---------Gao1111.11Gao1111.11Zhu5555.55           1111.11Zhu0.00Executive Statistics:SelectCount (*), COUNT (XM), COUNT (all XM), COUNT (distinct Sal), COUNT (all Sal), Count (Sal), SUM (1) fromtable3; Results:5   4  4  3   5   5  5MAX ([Distinct|all]x) The maximum value of the row x column is selected in the function statistics table. The "parameter" all means the maximum value for all values, distinct only the maximum value for the different values, the default is all if there is a parameter distinct or all, a space is separated from the X (column). "Parameter" x, can be a number, character, or Date field "return" corresponding to the X field type SQL>SelectMax (distinct Sal), Max (XM) fromTable3; Max (distinctsal) max (XM)---------------- --------5555.55zhumin ([Distinct|all]x) The maximum value of the row x column is selected in the function statistics table. The "parameter" all means the maximum value for all values, distinct only the maximum value for the different values, the default is all if there is a parameter distinct or all, a space is separated from the X (column). "Parameter" x, can be numeric, character, or Date Type field "return" corresponding to X field type Note: A character field that ignores null (NULL) SQL>SelectMIN (Distinct sal), Min (XM), MIN (Distinct xm), min (All XM) fromTable3; Min (distinctsal) min (XM) min (distinctxm) min (ALLXM)---------------- -------- --------------- ----------0Gao Gao

Clustering functions of Oracle SQL functions

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.