Skip to content

Commit b080384

Browse files
committed
Fixed the query builder to correct the group by / order by order
1 parent 59f99cf commit b080384

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal-packages/clickhouse/src/client/queryBuilder.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ export class ClickhouseQueryBuilder<TOutput> {
7979
if (this.whereClauses.length > 0) {
8080
query += " WHERE " + this.whereClauses.join(" AND ");
8181
}
82-
if (this.orderByClause) {
83-
query += ` ORDER BY ${this.orderByClause}`;
84-
}
8582
if (this.groupByClause) {
8683
query += ` GROUP BY ${this.groupByClause}`;
8784
}
85+
if (this.orderByClause) {
86+
query += ` ORDER BY ${this.orderByClause}`;
87+
}
8888
if (this.limitClause) {
8989
query += ` ${this.limitClause}`;
9090
}

0 commit comments

Comments
 (0)