tsql - Is there a "Default Order By Column" in SQL Server? -


when execute query select col1, col2, col3 table, gets sorted primary key ascending.

i'm wondering if there way specify different column, order createddate desc if there no order clause?

i doubt (since unintuitive, wondering anyway.

no. ordering see artifact of query optimizer's strategy. relational theory forbids there implicit ordering of set of data.

you can't count on same ordering next time same query because optimizer strategy depends on context , data might change.


Comments

Popular posts from this blog

how to build hyperlink for query string in php -

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

queue - mq_receive: message too long -