Thread: MySQL problem
View Single Post
Old 08-07-2006, 01:12 AM  
STTBoss
Confirmed User
 
Join Date: Jun 2004
Location: CZ
Posts: 225
Quote:
Originally Posted by Brujah
may need to use some code for it, like php or other
without knowing the values of probability index column, the first that comes to mind that it might get done is:

create a temporary table
insert into the temp table an id for each probability index difference
- if it's 83, put it in 83 times
- next one is 41, insert the id 41 times

select id from temp table order by rand();
select * from main table where temp table id = main table id;

maybe not elegant, but it's the first thing that came to mind without knowing if a mysql function exists to handle it easier
great idea doing it with temporary table... i will try to form your idea into a more elegant solution, but thanks a lot!
__________________
TrafficAdept.com
GET BETTER QUALITY TRAFFIC
GET PAID MORE TO SELL TRAFFIC

by DamageX and STTBoss
STTBoss is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote