How to write a query to unsort while retrieving the data. it should be niether in ascending nor descending order

Showing Answers 1 - 3 of 3 Answers

Harsh Athalye

  • Feb 17th, 2007
 

In SQL Server:

 select * from table order by NEWID()

  Was this answer useful?  Yes

Lavu

  • May 6th, 2007
 

If you are selecting the data from the table it will not sort the data. If you are using group by clause then it will sort the result in the ascending order other wise not.

  Was this answer useful?  Yes

malapati

  • Oct 10th, 2008
 

By default the "select" statement retreives the data in "unsort" form. If we want to sort the data we need to use "ORDER BY" clause.

eg: select * from < table name > order by < column name >;
 
if we specify "desc" after column name it sort out in desending order otherwise default is asending order

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions