Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> distinct and replace...can anyone help?

distinct and replace...can anyone help?

From: kinch <kinch55_at_yahoo.com>
Date: 13 Sep 2001 06:42:41 -0700
Message-ID: <4566a8e8.0109130542.77eaa46e@posting.google.com>


Hi,

I have a legacy database to deal with where the company name field is of the form -
Company Name (Branch Name).

Companies with no branches are in the form - Company Name

I want to select just the company name and i can do this with select replace(name,substr(name,instr(name, ' ('))) from table;

This works fine and gets me a list of company names only.

I need to wrap a distinct round this though and when i do I do get just one version of any of the companies with multiple branches...unfortunately when i use the distinct I don`t get any of the companies with no branches.

Anyone know why this is?

Cheers,
kinch Received on Thu Sep 13 2001 - 08:42:41 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US