Possible duplicate:
how to select random unique records each time an SQL query is executed
I have a database of this structure:
id int
image_name varchar(200)
category_id int
There are about 200 entries, id is unique, and there are about 20 categories, and my iamges are divided between them.
Could you help me get a query that will give me 10 entries using UNIQUE category_ids?
source
share