select ts.id as status_id , ts.status as status , isnull(b.cnt,0) as status_count from task_status ts left join (select status_id, count(*) cnt from task where assigned_to = 'XYZ' group by status_id)b on ts.id = b.status_id
Can any one help in writing Equivalent Nhibernate query for the above query.
Thanks in advance