public IColumnsListSimple SubQuery(IStatementSelect select, string alias = "") { if (!string.IsNullOrEmpty(alias)) { alias = " AS " + SqlBuilder.FormatColumnAlias(alias); } this.Raw('(' + select.GetSql(false) + ')' + alias); return(this); }
public IColumnsListSimple SubQuery(IStatementSelect select, string alias = "") { if (!string.IsNullOrEmpty(alias)) { alias = this.Parameters.AliasOperator + SqlBuilder.FormatColumnAlias(alias, this.Parameters); } this.Raw('(' + select.GetSql() + ')' + alias); return(this); }
public IColumnsListAggregation SubQuery(IStatementSelect select, string alias = "") { if (!string.IsNullOrEmpty(alias)) { alias = " as " + SuperSql.FormatColumnAlias(alias); } this.Raw('(' + select.GetSql(false) + ')' + alias); return(this); }
public WhereList In(string column, IStatementSelect query) { CreateExpression(Enums.WhereType.In, column, " IN (" + query.GetSql(true).ToString() + ")"); return(this); }
public static IStatementSelect Columns(this IStatementSelect q, Func <IColumnsListAggregation, IColumnsListAggregation> f) { f.Invoke(q.Columns); return(q); }
public static IStatementSelect Join(this IStatementSelect q, Func <IJoinList, IJoin> f) { f.Invoke(q.Join); return(q); }
public static IStatementSelect GroupBy(this IStatementSelect q, Func <IGroupByList, IGroupByList> f) { f.Invoke(q.GroupBy); return(q); }
public static IStatementSelect OrderBy(this IStatementSelect q, Func <IOrderByList, IOrderByList> f) { f.Invoke(q.OrderBy); return(q); }
public static IStatementSelect Where(this IStatementSelect q, Func <IWhereList, IWhereList> f) { f.Invoke(q.Where); return(q); }
public static IStatementSelect Where(this IStatementSelect q, Action <WhereList> f) { f.Invoke(q.Where); return(q); }
public static IStatementSelect GroupBy(this IStatementSelect q, bool copyToColumns = false, params string[] columns) { q.GroupBy.Append(copyToColumns, columns); return(q); }
public static IStatementSelect GroupBy(this IStatementSelect q, Action <GroupByList> f) { f.Invoke(q.GroupBy); return(q); }
public static IStatementSelect OrderBy(this IStatementSelect q, params string[] columns) { q.OrderBy.Ascending(columns); return(q); }
public static IStatementSelect OrderBy(this IStatementSelect q, Action <OrderByList> f) { f.Invoke(q.OrderBy); return(q); }
public static IStatementSelect Where(this IStatementSelect q, params string[] columns) { q.Where.Equal(columns); return(q); }
public static string GetSQLSelectExist(IStatementSelect sql) => "SELECT EXISTS (" + sql.GetSql(true) + ");";
public static IStatementSelect Columns(this IStatementSelect q, params string[] columns) { q.Columns.Append(columns); return(q); }