querybuilder
querybuilder copied to clipboard
SqlKata.Execution Paginate Count with multiple column / distinct issue
new Query().From("my_table").Distinct().Select("a_column").Paginate(pageIndex, pageSize)
Will generate:
SELECT COUNT() AS count
FROM (SELECT DISTINCT * FROM my_table
) AS countQuery
should be:
SELECT COUNT() AS count
FROM (SELECT DISTINCT a_column FROM my_table
) AS countQuery
see: https://github.com/sqlkata/querybuilder/blob/87b4947c40fb45d53dff9fc41d7d14219e31ac96/SqlKata.Execution/QueryFactory.cs#L469 Argument 'columns' is null https://github.com/sqlkata/querybuilder/blob/87b4947c40fb45d53dff9fc41d7d14219e31ac96/SqlKata.Execution/QueryFactory.cs#L403