TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jonna jo
NA
33
29.9k
sql query to select questions randomly each time
Mar 28 2013 1:22 AM
Dear All,
I am using this following query to select questions randomly from database
sql query:
("select top 5 * from "+ practicallab +" where subtopic ='"+ sub_topic +"' order by newid()")
The above query is working to select questions randomly from database.
But my problem is,
If i want to select five questions randomly from twenty questions i can select using the above query.
(1,2,3,4,5,6,7........20)questions are there.
when i run the program like 5,9,15,18,20 question are displayed.
Again when i run the program 6,4,13,18,15 questions are displayed.
But when i run again and again one or two same questions are repeatedly displayed.
I want to display
different five questions
(randomly) each time.
what is the sql query for this process?
Reply
Answers (
1
)
writing xml to a file.. overwriting previous data
Searching data from database by giving condiition from asp.n