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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Help another zipcode delimma

Re: Help another zipcode delimma

From: Brian Peasland <dba_at_nospam.peasland.net>
Date: Fri, 16 Mar 2007 09:32:41 -0500
Message-ID: <45fa9e09$0$16288$88260bb3@free.teranews.com>


anitra_tanner_at_yahoo.com wrote:
> Thanks for the help on the previous question but now I have been
> presented with the following issue.
>
> In the same field we have 3 different scenarios
>
> 5 digit zip
> 12345
>
> 6 digit zip
> 12345-
>
> 10 digit zip
> 12345-1311
>
> I want to say give me all the zips that are 5 and 6 digits and where
> there is a 6 digit, dont show the
> dash (-). so when my query runs they will all look like 5 digit
> zips. I have made a seprate query for the 10 digit.
>
> previously I used length(zip) = 5
>

Why doesn't the SUBSTR function I showed you earlier not work here? (Rhetorical question)

You can use SUBSTR to get just the first 5 characters no matter how many are contained in the column and use that in your comparison.

HTH,
Brian

-- 
===================================================================

Brian Peasland
dba_at_nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown

-- 
Posted via a free Usenet account from http://www.teranews.com
Received on Fri Mar 16 2007 - 09:32:41 CDT

Original text of this message

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