querybuilder icon indicating copy to clipboard operation
querybuilder copied to clipboard

SqlKata.Execution Paginate Count with multiple column / distinct issue

Open EcoleKeine opened this issue 2 years ago • 0 comments

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

EcoleKeine avatar Sep 27 '21 04:09 EcoleKeine