Hi I dont know exactly why u need this but this can be done in MySQL/PERL create a file called random.pl i select a random reecord from Temp table with PK temp_id #! /usr/bin/perl -w use Mysql; $i = (10*rand())%10; $dbh = Mysql->Connect('localhost','DBNAME','root'); $sth = $dbh->Query("Select * from Temp"); $no = $dbh->Query("Select COUNT(temp_id) from Temp"); @nr = $sth->FetchRow; for($n=0; $n<@nr[0]; $n++) { @row = $sth->FetchRow; if($n == $i) { print @row; } } On Tue, 6 Feb 2001, Culley Harrelson wrote: > Any suggestions on how to select a random record from > any given table? > > Culley > > __________________________________________________ > Do You Yahoo!? > Yahoo! Auctions - Buy the things you want at great prices. > http://auctions.yahoo.com/ >
Re: [GENERAL] selecting a random record
Arun Malhotra - Roll No.99007 Sun, 11 Feb 2001 00:53:46 -0800
- [GENERAL] selecting a random record Culley Harrelson
- Re: [GENERAL] selecting a random record Warren Vanichuk
- Re: [GENERAL] selecting a random record Alexey Borzov
- Re: [GENERAL] selecting a random record Arun Malhotra - Roll No.99007
- Re: [GENERAL] selecting a random record Culley Harrelson