var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: sort order
Can anyone please tell me what is default sort order while inserting data using select stmt in ASE12.5.
insert into tab2 (col1,col2,col3)
select distinct col1,col2,col3
where col4 is not null.
tab1 has clustered index on col4
tab2 has unique clustered index on col3,col2,col1
which way data will be inserted
sorted according to select list ?
sorted based on clustered index? ( i dont think so)
any other option?
Any help in this is appreciated.
thanx in advance,
There is no default order. If you do not specify an order by clause then there is no guarantee that the same query will always produce the results in the same sequence.
If the table is not partitioned, and if it uses page-level locking (APL), then the default order for the rows being retrieved will probably conform to the clustered index.
In all other cases the default order is unknown.
So, as pdreyer says - you should NEVER rely on the rows from a query being returned in a particular order when you don't specify an ORDER BY clause.