Thread: MySQL problem
View Single Post
Old 08-07-2006, 01:06 AM  
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
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
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote