Exemple #1
0
        public string GenerateSqlString(ISqlStatement sqlStatement)
        {
            if (sqlStatement == null)
            {
                return(null);
            }

            var sql = GenerateFrom(sqlStatement.Find(StatementKeys.From));

            AddSelect(ref sql, sqlStatement.Find(StatementKeys.Select));
            AddWhere(ref sql, sqlStatement.Find(StatementKeys.Where));
            AddGroupBy(ref sql, sqlStatement.Find(StatementKeys.GroupBy));
            AddHaving(ref sql, sqlStatement.Find(StatementKeys.Having));
            AddOrderBy(ref sql, sqlStatement.Find(StatementKeys.OrderBy));

            return(sql);
        }