select
t.Ticketid, t.subject, t.createdby,
count(TicketConversationId) as counts
from
dbo.ticket t
join
dbo.TicketConversation tc on t.ticketid = tc.ticketid
group by
t.Ticketid, t.subject, t.createdby
var Result = from t1 in Tickets
join t2 in TicketConversations on t1.TicketId equals t2.TicketId
select new { t1.TicketId, t1.Subject , comments = t2.TicketConversationId };
請爲提供一些LINQ嘗試你正在嘗試做 –
還有你是什麼數使用? EF? –
是的,它使用的是EF –