Re: Sort in Query
Date: Thu, 03 Jan 2008 20:15:30 +0100
On Thu, 03 Jan 2008 16:16:26 +0100, Bram MariŽn <bma_at_nospam.abiware.be> wrote:
>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 ?
You are comparing *strings* not numbers. As there is varchar2 column in the left hand side, and a string in the right hand side, there will be no implicit conversion. Also changes are your explain plan use the index, and the order by is suppressed.
You need to fix the mess, or learn to live with it.
-- Sybrand Bakker Senior Oracle DBAReceived on Thu Jan 03 2008 - 13:15:30 CST