2
我與很多消息進行了會話,我想按照ConversationMessages表中最後一條消息的創建日期的順序排列會話。nHibernate - 選擇後的子選擇
我該如何在nHibernate的queryOver中寫這個。我應該使用子查詢嗎?
select distinct c.ConversationId,
(select max(CreatedDate)
from tConversationMessage mess where mess.ConversationId = c.ConversationId
) as LastMessage
from tConversation c order by LastMessage