I have the following query that im using to return 2 random values.
I want to be able to return two (2) random unique values. Here is the query:
SELECT projects.id, projects.title, projects.description, projects.catid, projectimages.image, projectimages.projectid FROM projects INNER JOIN projectimages ON projects.id = projectimages.projectid WHERE featured = 'yes' ORDER BY Rand() LIMIT 2
It works correctly - but problem is - the table is not that big, and sometimes it returns two of the same value. So its lists 1 project twice.