permanent multiple column sort [message #19691] |
Wed, 03 April 2002 22:50 |
Nick
Messages: 64 Registered: February 2000
|
Member |
|
|
How do i permanently sort by multiple columns?
In effect the following which of course doesn't work:
create table old (a number, x number);
insert into old values (2, 4);
insert into old values (1, 2);
insert into old values (2, 3);
insert into old values (1, 1);
insert into old values (2, 1);
create table new as
select a,
x
from old
order by a,
x desc;
|
|
|
Re: permanent multiple column sort [message #19693 is a reply to message #19691] |
Wed, 03 April 2002 23:27 |
seng
Messages: 191 Registered: February 2002
|
Senior Member |
|
|
Database can't do sorting based on data insert into table. In Oracle database, index is used to do the sorting to improve performance, when query large table. Hope this is helping
|
|
|
Re: permanent multiple column sort [message #19699 is a reply to message #19693] |
Thu, 04 April 2002 04:35 |
Su
Messages: 154 Registered: April 2002
|
Senior Member |
|
|
As per my knowledge there is no sorting concept in RDBMS unless it is just a way of accessing the rows/columns. The name itself says it is a Relation Database, which is completely different from a flat file ISAM or VSAM methods. Correct me if I am wrong.
Good luck :)
|
|
|
Re: permanent multiple column sort [message #19728 is a reply to message #19693] |
Thu, 04 April 2002 22:42 |
seng
Messages: 191 Registered: February 2002
|
Senior Member |
|
|
Yes, it doesn't have sorting for rows/columns. But in indexes, it does do the sorting before create the index from sort space, which is needed by creation of indexes. However, i don't know whether it does sorting in physical level (block) or no.
|
|
|