Chat2DB icon indicating copy to clipboard operation
Chat2DB copied to clipboard

Suggestion: The total number of rows in the query with distinct is not accurate

Open saajireign opened this issue 11 months ago • 1 comments

Version:Chat2DB v3.1.17 Phenomenon: image 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.

saajireign avatar Mar 26 '24 08:03 saajireign

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

openai0229 avatar Mar 26 '24 11:03 openai0229