Random Record from Recordset
Posted
by
Tony Hanks
on Stack Overflow
See other posts from Stack Overflow
or by Tony Hanks
Published on 2012-12-05T04:59:07Z
Indexed on
2012/12/05
5:03 UTC
Read the original article
Hit count: 179
I have the fillowing Query:
SELECT a.*,
ps4_media.filename,
ps4_galleries.name as galleryname,
ps4_media_iptc.description,
ps4_media_iptc.title,
ps4_media_iptc.headline,
ps4_media.date_added,
ps4_galleries.created,
ps4_folders.name as foldername,
ps4_galleries.gallery_count FROM ps4_media_galleries a INNER JOIN (SELECT ps4_media_galleries.gallery_id,
min(ps4_media_galleries.gmedia_id) AS minID FROM ps4_media_galleries GROUP BY ps4_media_galleries.gallery_id) b ON a.gallery_id = b.gallery_id AND a.gmedia_id = b.minID
INNER JOIN ps4_media ON ps4_media.media_id = a.gmedia_id INNER JOIN ps4_folders ON ps4_folders.folder_id = ps4_media.folder_id
INNER JOIN ps4_galleries ON ps4_galleries.gallery_id = a.gallery_id
INNER JOIN ps4_media_iptc ON ps4_media_iptc.media_id = a.gmedia_id
ORDER BY ps4_galleries.created DESC
How do I get ps4_media.filename to be random, everything else is fine just want the thumbnail which ps4_media.filename is to be and of the records in the found set.
© Stack Overflow or respective owner