我有一个名为ms_message的数据库表:有6列(id,senderid,receiverid,content,isRead,receivedTime)。我想在Doctrine中通过发件人获取最新收到的邮件组,但我无法运行子查询或使用order by和group by。
SQL中的查询如下所示:
SELECT * FROM (SELECT * FROM ms_message WHERE receiverId = :receiver ORDER BY receivedTime) GROUP BY senderId;
答案 0 :(得分:0)
我不认为Doctrine支持SELECT * FROM (SELECT ...)