Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

distinct多列的时候查询数量BUG #1803

Closed
guixincui opened this issue Jun 29, 2017 · 1 comment
Closed

distinct多列的时候查询数量BUG #1803

guixincui opened this issue Jun 29, 2017 · 1 comment
Labels
Milestone

Comments

@guixincui
Copy link

#1715

如果select distinct col1,col2... from tb ,这种情况count还是有问题。
即 queryBlock.getSelectList().size()大于1的情况。

if (option == SQLSetQuantifier.DISTINCT && queryBlock.getSelectList().size() == 1) {
SQLSelectItem firstItem = queryBlock.getSelectList().get(0);
SQLAggregateExpr exp = new SQLAggregateExpr("COUNT", SQLAggregateOption.DISTINCT);
exp.addArgument(firstItem.getExpr());
firstItem.setExpr(exp);
queryBlock.setDistionOption(0);
}

@wenshao wenshao added the Bug label Jun 29, 2017
@wenshao wenshao added this to the 1.1.11 milestone Jul 11, 2017
@wenshao
Copy link
Member

wenshao commented Jul 13, 2017

https://github.com/alibaba/druid/releases/tag/1.1.1
问题已经修复,请使用新版本

@wenshao wenshao closed this as completed Jul 13, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants