1
select SF.FOLDER_NAME,SF.CREATED_DATE,COUNT(st.FOLDER_ID) 
from SURVEY_FOLDER SF with (nolock) left outer join SURVEY_TEMPLATE ST with (nolock) 
on SF.FOLDER_ID=ST.FOLDER_ID 
group by SF.FOLDER_NAME,SF.CREATED_DATE

Linq でこのクエリが必要です:

このクエリを試しましたが、できませんgroup by

私のLinqクエリ:

var data = (from xx in VDC.SURVEY_FOLDER
                        join yy in VDC.SURVEY_TEMPLATE
                        on xx.FOLDER_ID equals yy.FOLDER_ID into g
                        from grt in g.DefaultIfEmpty()
                        select
                        new
                        {
                            xx.FOLDER_NAME,
                            xx.CREATED_DATE,
                            count = g.Count()
                        }).ToList();
4

1 に答える 1