Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help another zipcode delimma
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
Think about using DECODE or CASE or Regular Expressions. There are probably a dozen ways, some with LENGTH, to solve the problem.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Thu Mar 15 2007 - 15:50:38 CDT
![]() |
![]() |