请问这个 SQL 语句用 Laravel 怎么实现?
select a.* from user_listened as a right join
(select parent_id,user_id, max(updated_at) as maxtime from user_listened where parent_id is not null group by parent_id) as b
on a.user_id=b.user_id and a.updated_at=b.maxtime order by a.updated_at desc;
推荐文章: