sql - Does select top 10 * from tablename give same result every time? -


i want know select top 10 * tablename give same result every time?

thanks in advance

no. result set unordered unless specify order by clause. then, order by needs stable, meaning keys have no ties (you accomplish putting primary key last keys ordering).

there several reason why results might differ. obviously, underlying data might change, guessing not gist of question.

the primary reason on multi-threaded machine, different threads reading data. thread returns data indeterminate, don't know first ten rows (without order by).

sql not guarantee tables read in order processing queries. however, in practice, think sql server read pages in order.


Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Restarting Supervisor and effect on FlaskSocketIO -

php - Mongodb connectivity error -