我有两张桌子
table_posts: id_post | post | date_post
table_likes: id_like | id_post | date_like
我想显示按date_like
我尝试使用JOIN
,但它没有检索phpmyadmin
中预期的结果(重复)
SELECT m. *
FROM table_posts AS m
JOIN table_likes AS p ON p.id_post = m.id_post
WHERE (m.id_post =35 OR m.id_post =36) /*both posts were liked*/
ORDER BY p.date_like DESC
如何按照喜欢的日期检索订购的帖子?