我得到,如果弗洛姆我查詢的dupicate列名的錯誤和不知道如何解決我的查詢是重複的列名錯誤
SELECT distinct(courseid+senderid+recipientid) as diskey,
mess.id,
User.firstName as recipientName,
Course.name,
senderid,
recipientid,
courseid,
message,
mess.status,
mess.createdOn
FROM
(
SELECT *
from Message,User,Course
where Message.recipientid=User.id
and Message.courseid=Course.id
order by Message.createdOn DESC
) as mess,
User,
Course
WHERE senderid ='3'
OR recipientid='3'
GROUP BY diskey;
任何一個可以heplp
表的模式將是有益的。 –
和你得到的結果 –
@BrunoVieira重複列名 –