* SQL Group Function *
| s (num can be a column or ex
| pression)
| (null values are ign *
| ored, default between distin
| ct and all is all)
| ******************** ***************
| ****************************
| ****************
| AVG([distinct or all] num)
| -- average value
| COUNT(distinct or all] num)
| -- number of values
| MAX([distinct or all
| ] num) -- maximum value
|
| MAX([distinct or all] num)
| -- minimum value
| STDDEV([distinct or
| all] num) -- standard devi
| ation
| SUM([distinct or all
| ] num) -- sum of values
|
| VARIANCE([distinct o
| r all] num) -- variance of v
| alues
| ******************************** ***********************
| ************************
| * Miscellaneaous Functions : *
|
| ******************** ***************
| ****************************
| ****************
| DECODE(expr, srch1,
| return1 [,srch2, return2...]
| , default]
| -- if no search matches t
| he expression then the default is returned,
| -- otherwise,
| the first search that match
| es will cause
| -- the corres
| ponding return value to be r
| eturned
| DUMP(column_name [,fmt [,start_p
| os [, length]]])
| -- returns an column
| internal oracle format, used
| for getting info about a
| -- format options : 8 = oc
| tal, 10 = decimel, 16 = hex, 17 = characters
| -- return type
| codes : 1 = varchar2, 2 = n
| umber, 8 = long, 12 = date,
| -- 23 = raw,
| 24 = long raw, 69 = rowid,
| 96 = char, 106 = mlslabel
| GREATEST(expr [,expr2 [, expr3...]] | -- returns the largest val
| ue of all expressions
| LEAST(expr [,expr2 [, expr3...]] | -- returns the
| smallest value of all expre
| ssions
| -- if expr1 is not null, i
| t is returned, otherwise expr2 is returned
| -- returns sql error code query,
| of last error. Can not be used directly in
| -- value must
| be set to local variable fir
| st
| -- returns sql in query,
| error message of last error
| . Can not be used directly
| -- value must be set to lo
| cal variable first
| -- returns the user id of
| the user you are logged on as
| -- useful in s
| electing information from lo
| w level sys tables
| -- returns the
| user name of the user you a
| re logged on as
| -- returns inf
| ormation about the user you
| are logged on as
| -- options : E
| NTRYID, SESSIONID, TERMINAL,
| LANGUAGE, LABEL, OSDBA
| -- (
| all options not available in
| all Oracle versions)
| -- returns the number of b
| ytes used by the expression
| -- useful in s
| electing information about t
| able space requirements
| ******************** ***************
| ****************************
| ****************
| * SQL Date Functions (dt represe *
| nts oracle date and time)
| * (functions return *
| an oracle date unless otherw
| ise specified)
| ******************************** ***********************
| ************************
| ADD_MONTHS(dt, num)
| -- adds num months to
| dt (num can be negative)
| LAST_DAY(dt)
| -- last day of month in
| month containing dt
| MONTHS_BETWEEN(dt1, dt2) -- retu dt2
| rns fractional value of months between dt1,
| NEW_TIME(dt, tz1, tz zone 2
| 2) -- dt = date in time zo
| ne 1, returns date in time
| NEXT_DAY(dt, str) -- date etc..)
| of first (str) after dt (str = 'Monday',
| SYSDATE -- present system date | ROUND(dt [,fmt] -- roun
| ds dt as specified by format fmt
| TRUNC(dt [,fmt]
| -- truncates dt as spe
| cified by format fmt
| ******************************** ***********************
| ************************
| ******************************** ***********************
| ************************
| ABS(num) -- absolute
| value of num
| CEIL(num) -- smallest integer > or = num |
COS(num) -- cosine(n
| um), num in radians
| COSH(num)
| -- hyperbolic cosine(num)
|
|