尝试连接两个表并希望从第二个表中获取最新记录。在mysql中使用连接时从右表中选择最新记录
SELECT *
FROM gallery
LEFT JOIN images_videos ON gallery.ID=images_videos.gallery_id
WHERE gallery.user_id ="+another_userid+"
GROUP BY gallery.ID
ORDER BY gallery.ID DESC
通过这个查询我接到images_videos 但 我想从images_videos表中选择最新的图像 请帮 我在images_videos多个条目画廊表
我想要最新的图像最古老的图像为每个画廊。
请更好地描述你想要的。 image_videos中的每个图库条目是否有多个条目?对于每个图库条目,您需要来自image_videos的最新图像? – niyou