Chapter 7 Hints

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Using Single-Row Functions to Customize Output

A function is a subprogram that return a Value

Prepared By :Khaled AlKhudari www.maxvlearn.com 1


Prepared By :Khaled AlKhudari www.maxvlearn.com 2
Prepared By :Khaled AlKhudari www.maxvlearn.com 3
Prepared By :Khaled AlKhudari www.maxvlearn.com 4
case

Prepared By :Khaled AlKhudari www.maxvlearn.com 5


Prepared By :Khaled AlKhudari www.maxvlearn.com 6
Prepared By :Khaled AlKhudari www.maxvlearn.com 7
Prepared By :Khaled AlKhudari www.maxvlearn.com 8
Prepared By :Khaled AlKhudari www.maxvlearn.com 9
Prepared By :Khaled AlKhudari www.maxvlearn.com 10
Prepared By :Khaled AlKhudari www.maxvlearn.com 11
Prepared By :Khaled AlKhudari www.maxvlearn.com 12
Prepared By :Khaled AlKhudari www.maxvlearn.com 13
Prepared By :Khaled AlKhudari www.maxvlearn.com 14
SUBSTR(UPPER(first_name),1,3)

Prepared By :Khaled AlKhudari www.maxvlearn.com 15


Nested function example: split string into 3 segments

xxxxxx
String
space1 xxxxxxxxxxxxx space2 xxxxxxxxxxxxxxxx

• Segment 1= xxxxxx
SUBSTR(‘String’,1,INSTR(‘String',’ ‘ ,1,1)-1 ) FIRST_NAME

• Segment 2= xxxxxxxxxxxxx
SUBSTR(‘string', INSTR(‘string ',’ ‘,1,1)+1,
INSTR(‘string’,’ ‘,1,2)-INSTR(‘string’,’ ‘,1,1) -1) MIDDLE_NAME

• Segment 3= xxxxxxxxxxxxxxxx
SUBSTR(‘string', INSTR(‘string',’ ‘,1,2)+1) last_name

Prepared By :Khaled AlKhudari www.maxvlearn.com 16


Thank You

Prepared By :Khaled AlKhudari 17

You might also like