Document 4
Document 4
COUNT:
SYNTAX: select count (col-name) from table-name;
SQL> select count(salary) from sample;
COUNT(SALARY)
-------------
5
STANDARD DEVEATION:
SYNTAX: select stddev (col-name) from table-name;
SQL> select stddev(salary) from sample;
STDDEV(SALARY)
--------------
311207.326
LTRIM
-----
apple
RTRIM:
SYNTAX: select rtrim(‘char’) from dual;
SQL> select rtrim('appleooooo','o') from dual;
RTRIM
-----
apple
REPLACE:
SYNTAX: select replace(‘char’, oldno, newno) from dual;
SQL> select replace('123apple12',23,45) from dual;
REPLACE ('1
----------
145apple12
TRANSLATE:
SYNTAX: select translate (‘char’, oldno, newno) from dual;
SQL> select translate('123apple12',23,45) from dual;
TRANSLATE (
----------
145apple14
VSIZE:
SYNTAX: select vsize(‘char’) from dual;
SQL> select vize('apple is a fruit') from dual;
VSIZE('APPLEISAFRUIT')
----------------------
16
SUBSTR:
SYNTAX: select substr(‘char', index) from dual;
SQL> select substr('apple is a fruit',5) from dual;
SUBSTR ('APPL
------------
e is a fruit
MATHEMATICAL/NUMERICAL FUNCTIONS
ABSOLUTE:
It gives the absolute value I.e., without any signs
SQL> select abs (-23.65) from dual;
ABS (-23.65)
-----------
23.65
LEAST:
It returns the least value among them
SQL> select least (2,5,3,7,1) from dual;
LEAST (2,5,3,7,1)
----------------
1
GREATEST:
It returns the greatest value among them