コード例 #1
0
ファイル: LearnerStatusAction.cs プロジェクト: robertfall/LAD
        private void includeRegDate(SQLStringBuilder queryString, bool filterByDate)
        {
            var subQuery = new SQLStringBuilder();
            subQuery.Scope("Registration Dates", () =>
            {
                string[] subColumns = { "learnerKey", "MIN(regDate) as theRegDate" };
                subQuery.Select(subColumns);
                subQuery.From("enrollments");
                subQuery.GroupBy("learnerKey");
                if (filterByDate)
                {
                    filterHavingByDate(subQuery);
                }
            });

            if (filterByDate)
            {
                queryString.RightJoin(String.Format("{0} as e", subQuery.ToString()), "e.LearnerKey = ld.LearnerKey");
            }
            else
            {
                queryString.LeftJoin(String.Format("{0} as e", subQuery.ToString()), "e.LearnerKey = ld.LearnerKey");
            }
        }
コード例 #2
0
ファイル: LearnerStatusAction.cs プロジェクト: robertfall/LAD
 private static void groupByDivision(SQLStringBuilder queryString)
 {
     queryString.GroupBy("division");
 }