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

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -