if suppose we have written a SQL select command without using order by clause then what will be the column on which the sorting will done while displaying records of select command...
create table test
(
ID int identity (1,1) primary key,
em_id int,
name varchar(20),
address varchar(20)
mobile number int
)
suppose the table is like above structure and select command like
select * from test
then how can i check the column name on which the sorting is done by sql..
ORDER BYclause. There's no other way to specify ordering. Even when a specific storage order will return data in whatever way is cheapest unless anORDER BYclause is specified. That's quite common eg when parallel processing is usedORDER BYif you combine it with aOFFSET 0 ROWSor aTOP. But unsure if that would work in SQL Server 2008.