List:General Discussion« Previous MessageNext Message »
From:Test USER Date:November 24 2005 1:36pm
Subject:Re: Possible ways to sort numbers stored in a varchar column?
View as plain text  
Thanks i also found the function CAST which works ok.
So now i have three options:

CAST
LPAD
Adding zero

Any other sugestions are welcome!

Quoting SGreen@stripped:

> Test USER <testuser@stripped> wrote on 11/23/2005 07:36:43 PM:
> 
> > Is the only way to sort numbers stored in a varchar column to use
> lpad?
> > Are there any other columntypes that allow both characters and 
> > numbers that can 
> > sort numbers correct?
> > 
> > -------------------------------------------------
> > FREE E-MAIL IN 1 MINUTE!
> >  - your.name@stripped - http://www.pc.nu
> > 
> 
> You can try adding zero to the column. It's a function acting on a value
> 
> so any chance of using an index is eliminated but you can get your
> columns 
> as numbers that way. To answer your second question, no. Fields are
> either 
> strings or numbers but never both.
> 
> Shawn Green
> Database Administrator
> Unimin Corporation - Spruce Pine



 

-------------------------------------------------
FREE E-MAIL IN 1 MINUTE!
 - your.name@stripped - http://www.pc.nu
Thread
Possible ways to sort numbers stored in a varchar column?Test USER24 Nov
  • Re: Possible ways to sort numbers stored in a varchar column?SGreen24 Nov
    • Re: Possible ways to sort numbers stored in a varchar column?Test USER24 Nov