Re: Select data prior to a character in a row?

From: William Robertson <williamr2019_at_googlemail.com>
Date: Mon, 7 Jan 2008 00:31:43 -0800 (PST)
Message-ID: <f5101a9f-0769-44c4-a2fd-95b75f5b7fde@i3g2000hsf.googlegroups.com>


On Jan 3, 7:38 pm, DP <dxpe..._at_gmail.com> wrote:
> ...
> I can select the data after the : with-
> select substr(name,instr(name,': ')+2,length(name)) from table;
> ...

btw the default if you don't specify a length for SUBSTR() is to return the remainder of the string, which is what you want here (and LENGTH(name) is wrong anyway), so that could be

select substr(name,instr(name,': ')+2) from table; Received on Mon Jan 07 2008 - 02:31:43 CST

Original text of this message