SQL Chap3A
SQL Chap3A
Objectives
Input Output
Function
arg 1 Function
performs action
arg 2 Result
Value
arg n
Two Types of SQL Functions
Functions
Single-row Multiple-row
Functions Functions
Single-Row Functions
Single-row
General Number
functions
Conversion Date
Character Functions
Character
functions
LOWER CONCAT
UPPER SUBSTR
INITCAP LENGTH
INSTR
LPAD
Case Conversion Functions
Function Result
Function Result
ENAME WEEKS
------------ ----------------
KING 830.93709
CLARK 853.93709
MILLER 821.36566
Date Functions
FUNCTION DESCRIPTION
Number of months
MONTHS_BETWEEN
between two dates
Add calendar
ADD_MONTHS
months to date
Next day of the date
NEXT_DAY
specified
LAST_DAY Last day of the month
Datatype
conversion
NUMBER VARCHAR2
DATE VARCHAR2