In article <11**********************@g10g2000cwb.googlegroups .com>,
ma*********@yahoo.com says...
A client gave a spreadsheet that has this column format:
.u29034c.ccridl.djkcjd
I need to parse out only the characters between the first two periods
in the column using only SQL.
Any suggestions?
DB2 8.2 on AIX
Thanks in advance!
Martin
drop table t1;
create table t1 (c1 char(40));
insert into t1 (c1) values ('.u29034c.ccridl.djkcjd'),
('.gfovfgpt.cdft.fdfgrt');
select substr(c1,posstr(c1,'.') + 1,
posstr(substr(c1,posstr(c1,'.') + 1), '.')
- posstr(c1,'.') )
from t1;
1
----------------------------------------
u29034c
gfovfgpt
2 record(s) selected.