English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Stil stucked :(

2007-06-14 02:06:24 · 3 answers · asked by rystest 2 in Computers & Internet Programming & Design

Thanks for your reply but SELECT * FROM orders ORDER BY NewID() ASC doesn't work. It still sorted randomly. I can use order by id asc ofcourse but then it's no random values anymore

2007-06-14 02:13:52 · update #1

3 answers

Yes, of course it makes total sense that the following
SELECT * FROM orders ORDER BY NewID()ASC
will arrange the records by random!

You're saying: Arrange the records according to a random field by ascending order.

Hope this helps.

2007-06-14 04:12:42 · answer #1 · answered by Smutty 6 · 0 0

SELECT * FROM orders ORDER BY orders.NewID;

Try ditching the () from the field name NewID, I also specified the table name to ensure that there is no confusion as to the field in question. New is a reserved word and parenthesis usually indicate a function there may have been a contention in the parsing of the command why this would NOT trigger an error I don't know. But on the off chance that this is happening and defaulting into just a general Select all command try the above command. Ensure you are specifing the correct field name. Doy you have an actual field called NewID or is it called ID and you want a listing of the New ones....

Order By should default to an ascending format
You can append ASC for ascending or DESC for descending

Also end you statement with a semicolon ;

2007-06-14 09:34:16 · answer #2 · answered by MarkG 7 · 0 0

You could try:

SELECT * FROM orders ORDER BY NewID() ASC

ASC = Ascending

2007-06-14 09:11:48 · answer #3 · answered by Andy G 4 · 0 0

fedest.com, questions and answers