SQL Query

SpaceshipSpaceship
Watch

boomers

Established Member
Impact
4
Is there a way to select a random record from within an SQL database?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains — AI StorefrontUnstoppable Domains — AI Storefront
Might try looking at the mysql.org website.

I cant think of one off hand though.

You could create a php/js script that generated random numbers, and have it feed those into a variable for calling record numbers....
 
0
•••
0
•••
Which DBMS? If you're talking about MS SQL, do a order by newid() trick ;)

"select * from sometable order by newid()"

If you're talking abouit MySQL use rand:

"select * from sometable order by rand()"
 
0
•••
If you're looking to select just one record do this query

Code:
select * from table where some_key = rand()
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer
CatchedCatched

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back