Re: Sort in Query

From: Bram MariŽn <>
Date: Thu, 03 Jan 2008 16:16:26 +0100
Message-ID: <>

On Thu, 03 Jan 2008 05:55:47 -0800, wrote:

>> Bram

> You need to look at an ASCII table and see the character codes
> involved and the 'logic' may then reveal itself to you; as defined a
> '/' is a decimal 047, and a '0' is a decimal 048. A '/', therefore,
> will always sort BEFORE a '0' in a text field (remember you're now
> using character strings, not numeric values, for your invoice
> number).


I understand that logic, but why is there a difference in the sort (both ASCII I assume) in the resultset of a query without a whereclause and the resultset of a query with a whereclause (INV_NR>'somevalue')

If you do :
WHERE INV_NR>'3307/0002' ORDER BY INV_NR I would assume Oracle returns me invoice_no 3307/0003, and not 33070001, because / < 0 ?

Bram Received on Thu Jan 03 2008 - 09:16:26 CST

Original text of this message