Hi,
I'm currently doing:
However, there is a field in there called client_detail_id_fk.
How, we wanna really only get 1 record per advertiser ... but I'm a little unsure how to do this.
This would obviously get distinct client_ids, but we actually need a record to go with it:
Is this even possible? Or shall I just make the LIMIT a bit higher, and then use my perl code to make sure it only adds advertisers offers which have not already been put into the loop?
TIA
Andy
I'm currently doing:
Code:
SELECT * FROM Clients_Pool WHERE client_offer_region_id = 310 ORDER BY RAND() LIMIT 3
However, there is a field in there called client_detail_id_fk.
How, we wanna really only get 1 record per advertiser ... but I'm a little unsure how to do this.
This would obviously get distinct client_ids, but we actually need a record to go with it:
Code:
SELECT DISTINCT(client_detail_id_fk) FROM Clients_Pool WHERE client_offer_region_id = 310 ORDER BY RAND() LIMIT 3
Is this even possible? Or shall I just make the LIMIT a bit higher, and then use my perl code to make sure it only adds advertisers offers which have not already been put into the loop?
TIA
Andy