Re: Dumb Character Column
Date: Tue, 26 Jan 2010 18:16:14 -0800 (PST)
Message-ID: <d84a9c57-afc7-4ebe-9121-241dcdb67ec4_at_n4g2000yqf.googlegroups.com>
On Jan 26, 5:50 pm, The Magnet <a..._at_unsu.com> wrote:
snip
> Hi,
>
> Ok, whomever wrote this dumbass application should be put on trial.
>
> Anyhow, we have a column in our table which is defined as VARCHAR2,
> but contains both numbers AND character data.
>
> Problem is that we need to do some < & > in a query on the numeric
> content. But, because of the character data we get an invalid
> number. If we quote the numbers it does a character compare, not a
> numeric compare.
>
> Still looking on the internet for an answer, but anyone here have any
> ideas?
>
> Thanks!
You could do an order by to sort the character field generate some rownums and then select out just the rownums to create a number for that field.
Won't scale very well if you have many rows in the table ... Received on Tue Jan 26 2010 - 20:16:14 CST