Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
4
Reply
How make order random and distinct in sql query
Joma Rajab
Sep 1 2016 11:03 AM
279
Reply
I need to select random value from table and it should be distinct . I tried but I could not please help
this the query I have used but I got error say order by item must appear in the select list if select distinct is specified
string
checkentrycmd =
"select distinct TOP(10) * from dbo.Quiz where MaID="
+ Request.QueryString[
"Id"
].ToString() +
" ORDER BY CHECKSUM(NEWID())"
;
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
Why SQL server used with ASP.NET mostly
DataSet/SqlDataReader with DataList