How can I order my resultset by NEWID to get a random order?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Out of the box, this is not possible, but there’s an easy way to embed provider-specific expressions in the OrderedBy() and FilteredBy() expressions.
In your case (assuming you’re using SQL Server):
What happens here is that every word with a “$” prefix is sent to the database provider “as is” (without the “$” of course). The disadvantage is that this will only work for one provider (so you can’t simply switch to MySql and make it work without changing code)