ordering alphanumerical columns
From: Ralf <Miko_at_boehrer.de>
Date: 17 Mar 2003 06:45:04 -0800
Message-ID: <fa624200.0303170645.10704d32_at_posting.google.com>
Date: 17 Mar 2003 06:45:04 -0800
Message-ID: <fa624200.0303170645.10704d32_at_posting.google.com>
Hi,
I have a table with 1 column (=name), which is declared as: Varchar2 (because there can be numbers as well as strings).
My table has 6 rows with the contents: '1', '2', '3', 'A', 'B' and 'C'.
select * from table where name > '2';
Has as result: '3', 'A', 'B', 'C'
select * from table order by name
Has as result: 'A', 'B', 'C', '1', '2', '3'
That means:
Within "where" : 'A' > '2' is true
Within "order by" : 'A' > '2' is false
What's the reason for this strange behaviour ? And how can I force the "order by" statement to sort 'A' > '2' ?
Please response to me if you have any ideas or solutions !
Thanks in advance.
Ralf
Received on Mon Mar 17 2003 - 15:45:04 CET