Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: ORACLE SUBSTR FUNCTION HELP
Dave wrote:
> I am trying to get the city name from an address column of type VARCHAR2(80)
>
> The address looks as follow:
> ADDRESS
> --------------------------------------------------------------------------------
> 2800 Montrose Ave. Lacresenta, CA 92832
> 1231 Fullerton Ave. Fullerton, CA 92898
> 3301 Huston Ave. Garden Grove, CA 92123
> 1234 Placentia Rd. Placentia, CA 92871
> 34 Starbucks Rd. Seattle, WA 43249
> 1214 Ford Ave. LA, CA 98649
> 1317 Bond Ave. LA, CA 98649
>
> How do I get the city for the substring. I am trying to group my query by the city.
>
> Thanks
All of the responses are correct if your given sample data represents
every real row in your database. Hopefully, no one lives in Canada where
the zip code becomes the postal code and has embedded spaces. Hopefully,
no one lives in an apartment in Saint Louis where you have too many
periods: 999 Orange Av. Apt 3. St. Louis, MO xxxxx. Too many hopes,
though, don't make for a good query. I think Sybrand is right ... you
need to consider a better db design first.
Received on Mon Sep 30 2002 - 12:21:58 CDT
![]() |
![]() |