/// <summary> /// SQL 'GROUP BY' clause extensions. Add new 'GROUP BY' in clause. /// </summary> /// <param name="command">The command.</param> /// <param name="phrase">The Expression phrase.</param> /// <returns>The command.</returns> public static APSqlSelectCommand group_by_add(this APSqlSelectCommand command, APSqlExprPhrase phrase) { if (command.GroupByClause == null || command.GroupByClause.Next == null) { command.GroupByClause = new APSqlGroupByClause(phrase); } else { APSqlExprPhrase exist = command.FromClause.Last as APSqlExprPhrase; exist.SetNext(phrase); } return(command); }
/// <summary> /// Create a new 'GROUP BY' clause with one 'expression' phrase. /// </summary> /// <param name="phrase">'SELECT' phrase.</param> public APSqlGroupByClause(APSqlExprPhrase phrase) { SetNext(phrase); }
/// <summary> /// SQL 'GROUP BY' clause extensions. /// </summary> /// <param name="command">The command.</param> /// <param name="phrase">The Expression phrase.</param> /// <returns>The command.</returns> public static APSqlSelectCommand group_by(this APSqlSelectCommand command, APSqlExprPhrase phrase) { command.GroupByClause = new APSqlGroupByClause(phrase); return(command); }