Postgresql Random Rec Set - no Duplicates with Livecode
harrison at all-auctions.com
Wed Feb 2 22:06:21 EST 2011
Hi yet again Pierre,
Ok, I did a test where I used the limit of 48 out of 49 records.
It didn't pick even one duplicate. Hurray!!! The code must
advance the record counter randomly so no duplicates
occur. Nice, but unexpected.
Ok, all is well now.
On Feb 2, 2011, at 9:41 PM, Rick Harrison wrote:
> Hi again Pierre,
> How do I avoid picking duplicates though?
> On Feb 2, 2011, at 6:09 PM, Pierre Sahores wrote:
>> Hi Rick,
>> SELECT *
>> FROM table
>> WHERE condition = true
>> ORDER BY hashfloat8(random())
>> LIMIT 10;
>> Are you sure that the order by + limit clauses used together can't suit exactly your needs ?
More information about the Use-livecode