![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Sorry question on SQL
Experts,
I need small help in oracle. I am just putting this question here because i think there are SQL geniuses here as well as UNIX. I have a string that contains the First name, Middle name and last name in one field in the table in Oracle. I need to extract each one of them seperately. Can any one help with sql for this please. Field in the table Quote:
Quote:
Thanks |
|
|||||
|
Hi, You can post the SQL or Oracle related questions in Oracle forum. The below query should help you. Code:
SELECT trim(DECODE(ROWNUM,1,SUBSTR(STR,1,INSTR(STR,' ',1)),
LENGTH(STR)-LENGTH(REPLACE(STR,' '))+1,SUBSTR(STR,INSTR(STR,' ',-1,1)),
SUBSTR(STR,INSTR(STR,' ',1,ROWNUM-1), INSTR(STR,' ',1,ROWNUM)-INSTR(STR,' ',1,ROWNUM-1))
)) STR1
FROM (SELECT 'Jody E Mcquire' STR FROM DUAL),ALL_TABLES
WHERE ROWNUM <= LENGTH(STR)-LENGTH(REPLACE(STR,' '))+1
ORDER BY ROWNUM
|
|
||||
|
String Check in String
Hi,
i need to check my string1 is in another string2. input_filename=017200910.DC30025 if [ my file has .DC3 ] then i need do some action Can anyone tell me how to check my string is in another string. example i need to check .DC3 is in 017200910.DC30025 |
![]() |
| Bookmarks |
| Tags |
| awk, awk trim, trim, trim awk |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|