You are here: Re: Find random stuff « PHP SQL « IT news, forums, messages
Re: Find random stuff

Posted by Stefan Rybacki on 01/10/06 15:52

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

J.O. Aho wrote:
> Stefan Rybacki wrote:
>> J.O. Aho wrote:
>>>> ...
>>>> This don't fit the OP, as instance with a higher Rated_Sum should be picked
>>>> more often than one with a low value, the way you suggest here would give each
>>>> row the same chance to be in the top of the list.
>> Correct.
>>
>>>> If wanting to get the results as in the first post, then procedure (mysql5) is
>>>> the only way to get it, without using help of PHP, if not be that strict, then
>>>> you can do it with subselects (mysql4) as Stefan suggested.
>> What do you mean by strict. Don't I get the same distribution like your
>> procedure except the fact of multiple entries having the same rated value?
>
> OP wanted to have 1/511 chance for a single number, while your example had
> 1/500 according to your own post. So 'strictly' would be a 1/511 chance.
>

Not the second query, where I developed a query using subqueries which achives
right this. 1/511, 10/511 and 500/511

Regards
Stefan

>
> //Aho

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1rc2 (MingW32)

iD8DBQFDw7wmyeCLzp/JKjARAgshAKDA4w6RGwJEHGdKITL1vmVFZ2vzcQCgxZcQ
ySML96p8la1PEd3Jb7mlT9o=
=svLP
-----END PGP SIGNATURE-----

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация