Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
wingsaga
Starting Member
2 Posts |
Posted - 2002-05-24 : 07:49:31
|
| If I have a table like this:[Name],[Opportunity]Peter, 3David, 5John, 2Dick, 0Mary, 9How can I random select a record according to the Opportunity value? That means Mary will be the highest opportunity to be selected and Dick will be the lowest.Thank you for your help and sorry for my poor English.Edited by - merkin on 05/24/2002 08:27:23 |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
Posted - 2002-05-24 : 08:42:10
|
I believe you've left out some detail in your question. Let me restate it and see if I've correctly inferred what you're trying to accomplish.You want a pseudorandom selection of name, weighted by the opportunity column but with an element of randomness.If that's the case, you'll need to tell us what kind of scale is represented by Opportunity. Is it linear? ( is an opportunity of 3 exactly 3 times more likely to be selected than an opportunity of 9? )quote: If I have a table like this:[Name],[Opportunity]Peter, 3David, 5John, 2Dick, 0Mary, 9How can I random select a record according to the Opportunity value? That means Mary will be the highest opportunity to be selected and Dick will be the lowest.Thank you for your help and sorry for my poor English.Edited by - merkin on 05/24/2002 08:27:23
setBasedIsTheTruepath<O> |
 |
|
|
wingsaga
Starting Member
2 Posts |
Posted - 2002-05-24 : 10:29:47
|
| I don't sure what kind of scale I should use but I think your method of using linear may suit my case. If I use linear, what and how should I do?Thank you for your reply. |
 |
|
|
graz
Chief SQLTeam Crack Dealer
4149 Posts |
Posted - 2002-05-24 : 10:31:42
|
| How about something like this: http://www.sqlteam.com/item.asp?ItemID=802===============================================Creating tomorrow's legacy systems today.One crisis at a time. |
 |
|
|
|
|
|
|
|