Useful shortcuts for vi editor

Saturday 20 February 2016

Oracle SQL Functions List - Most Used

Single-Row Functions

CONCAT
  • SELECT CONCAT('Alp','er') from dual; -- Alper
INITCAP
  • SELECT INITCAP('alper') from dual; -- Alper
LOWER
  • SELECT LOWER('AlpeR') from dual; -- alper
  • SELECT UPPER('alPer') from dual; -- ALPER
LENGTH
  • SELECT LENGTH('Alper') from dual; -- 5
SUBSTR
  • SELECT SUBSTR('Alper',4,2) from dual; -- er
  • SELECT SUBSTR('Alper',-2,2) from dual; -- er
  • SELECT SUBSTR('Alper',1) from dual; -- Alper
INSTR
  • SELECT INSTR('Alper') from dual; -- 5
  • SELECT INSTR('Alper','A',1,1) from dual; -- 1
  • SELECT INSTR('Alper','e',-2,1) from dual; -- 4
LPAD
  • SELECT LPAD(1000000,10,'$' ) from dual; -- $$$1000000
RPAD
  • SELECT RPAD(1000000,10,'$' ) from dual; -- 1000000$$$
REPLACE
  • SELECT REPLACE('AliVeli','iVeli','per') from dual; -- Alper
TRIM
  • SELECT TRIM('A l p e r') from dual; -- Alper
  • SELECT TRIM(leading 'X' from 'XXXXAlper') from dual; -- Alper
  • SELECT TRIM(trailing 'Y' from 'AlperYYY') from dual; -- Alper