Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

group by不支持别名 #385

Closed
honor100 opened this issue Sep 14, 2021 · 1 comment
Closed

group by不支持别名 #385

honor100 opened this issue Sep 14, 2021 · 1 comment
Labels
wontfix This will not be worked on

Comments

@honor100
Copy link
Contributor

描述
group by时对别名支持不大好,提示字段不存在: Column 'current_date_format' not existed.

重现
表结构:
CREATE TABLE pontos_statistics_user_behavior (
pkid bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id ##',
id varchar(100) NOT NULL DEFAULT '' COMMENT 'id ##',
uid varchar(100) NOT NULL DEFAULT '' COMMENT '用户ID #B-2#',
behavior_type varchar(100) NOT NULL DEFAULT '' COMMENT '行为类型 ##',
behavior_at bigint(13) NOT NULL DEFAULT '0' COMMENT '行为时间 ##',
entity_id varchar(100) NOT NULL DEFAULT '' COMMENT '实体ID ##',
entity_type varchar(100) NOT NULL DEFAULT '' COMMENT '实体类型 ##',
lib_code varchar(100) NOT NULL DEFAULT '' COMMENT '知识库编码 ##',
space_code varchar(100) NOT NULL DEFAULT '' COMMENT '空间编码 ##',
content_gmt_create bigint(13) NOT NULL DEFAULT '0' COMMENT '文档创建时间 ##',
gmt_create bigint(13) NOT NULL DEFAULT '0' COMMENT '创建时间 ##',
gmt_modified bigint(13) NOT NULL DEFAULT '0' COMMENT '更新时间 ##',
PRIMARY KEY (pkid)
UNIQUE KEY unq_id (id),
KEY idx_space_lib_code_behavior_at (space_code,lib_code,behavior_type,behavior_at),
KEY idx_lib_code_behavior_at (space_code,behavior_type,behavior_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=17898738 COMMENT='行为表 ##';
SQL:
select userbehavior.behavior_at as current_date_format, count(1) as current_content_total from pontos_statistics_user_behavior userbehavior where 1=1 group by current_date_format order by current_date_format asc;

环境

  • 数据库: mysql
  • 版本: 5.7.21

参数
可能与问题相关的设置参数

@stale
Copy link

stale bot commented Oct 1, 2021

由于此问题没有最近的活动,因此已被自动标记为陈旧。如果没有进一步的活动,会作为不活跃issue关闭。感谢你对本项目的贡献。 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Oct 1, 2021
@stale stale bot closed this as completed Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant