473,387 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Using ORDER BY rand() in SELECT query

I want to know what is the meaning of this Select statement after we have use order by clause if we use or not will it affect this statement

order by rand() limit 1
Jul 4 '07 #1
3 2405
r035198x
13,262 8TB
I want to know what is the meaning of this Select statement after we have use order by clause if we use or not will it affect this statement

order by rand() limit 1
It returns a random record
Jul 4 '07 #2
dafodil
392 256MB
I want to know what is the meaning of this Select statement after we have use order by clause if we use or not will it affect this statement

order by rand() limit 1
Of course it will affect the record....


To give you further understanding I have tried this code with my existing db..


SELECT * FROM `pdt_tracker` WHERE `Track_ID` =1 ORDER BY rand( ) LIMIT 0 , 30



and it returned a record with a randomed order of columns.....
Jul 4 '07 #3
Atli
5,058 Expert 4TB
I have edited the thread's title to better describe it's contents.
Please read the Posting Guidlines before posting

Moderator
Jul 4 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Jefferis NoSpamme | last post by:
I have a query that is showing new items in a store based upon their inventory date. The problem with my Random order sort is that when the "next" link is pressed, the random function is called...
2
by: Joe Blower | last post by:
When I execute the following SQL statement at the mysql> prompt, I get a random result: SELECT proxy FROM proxies WHERE active = 1 ORDER BY RAND() LIMIT 1; When I wrap it in my perl code, I...
5
by: Warren Wright | last post by:
Hi group, I have a select statement that if run against a 1 million record database directly in query analyzer takes less than 1 second. However, if I execute the select statement in a stored...
22
by: Nhmiller | last post by:
Is there a way to do this? Thanks. Neil Cat Paintings At Carol Wilson Gallery http://www.carolwilsongallery.com
19
by: bdt513 | last post by:
I am trying to extract the values from a query using VBA. Specifically, I want to concatenate all the values of the "rosEmail" field from query "qselRosterEmailList" into one string (strEmails). I...
8
by: rbg | last post by:
I did use query plans to find out more. ( Please see the thread BELOW) I have a question on this, if someone can help me with that it will be great. In my SQL query that selects data from table,...
3
by: dinox | last post by:
hello, i tried searching for something similar to my situation but i haven't found so far.. for example ... i have users table with 15 registered users and i want to show only 5 of them in front...
1
debasisdas
by: debasisdas | last post by:
Using Co-related sub query ======================== While a subquery is evaluated only once for each table, a correlated subquery is evaluated once for each row. Sub query can take value from...
3
by: nagmvs | last post by:
Hi to all I have one table with 6 columns and 20 rows.I want to sort each and every column when i click the column name in the table. for sorting i create one more page.when i click the column...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.