I need to get first two characters from first two words given in Oracle. Example follows:
example:
string--> 'ganjikunta ramesh varma'
output--> ga ra
I need to get first two characters from first two words given in Oracle. Example follows:
example:
string--> 'ganjikunta ramesh varma'
output--> ga ra
You can achieve it using combination of substr
and instr
. Try this:
Select substr(your_str, 1, 2)
|| substr(your_str, instr(your_str, ' '), 3) -- 3 is used to fetch space and two charcters
From dual;
Cheers!!