Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

order by after insert

Status
Not open for further replies.

acn242

IS-IT--Management
Nov 28, 2006
39
US
I have a table in which i insert into..
"insert into table1(...)(select ... from table2 order by A);"

but a "select * from table1;" does not return the correct order (primarykey_id is not in ascending order)

is there anyway to change this without importing and exporting data?

Thanks,
 
Because the physical order of database has no meaning, if we do not specify an ORDER for a query, we cannot guarentee the results will be the same every time we execute the same query (even if it may seem that way!)
 
Yes, that is my problem. The table is being exported into an external file, it is not being queried against, and so I cannot do any kind of ORDER BY. Someone said something about creating a clustered index to control ordering. Is there any validity to that logic?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top