Chat2DB
Chat2DB copied to clipboard
Suggestion: The total number of rows in the query with distinct is not accurate
Version:Chat2DB v3.1.17
Phenomenon:
suggestion:
As shown in the figure, it seems that the total calculation method of chat2db is to wrap the statements between select and from in the original query with count() and then retrieve the result. However, if there is a distinct keyword in the original query statement, if The original query found empty records, but count(distinct...) cannot count empty records, resulting in inaccurate results. It is recommended to wrap the count outside without changing the counting method of the original SQL statement.
Thank you for your support. My test version is 3.1.19, and I have not found any problems during testing. If you still encounter problems after upgrading to this version, please provide SQL query statements so that I can reproduce the problem