简体   繁体   English

在MySQL选择查询中获取错误1022

[英]Getting Error 1022 on a mySQL select query

I have a simple table i am trying to run a select query on. 我有一个简单的表,我正在尝试运行选择查询。 I keep getting this error. 我不断收到此错误。 #1022 - Can't write; #1022-不会写; duplicate key in table '/tmp/mysqltmp/#sql_120f_0' 表'/ tmp / mysqltmp /#sql_120f_0'中的重复键

Here is the table info 这是表格信息 在此处输入图片说明

And this is the query im trying to run 这是我正在尝试运行的查询

SELECT COUNT( name ) , CONCAT( userapps.activity,  '/', userapps.class ) 
FROM userapps
GROUP BY name

Weird query; 奇怪的查询; do you want: 你想要:

  SELECT CONCAT(u.activity,'/',u.class) activity_class, COUNT(u.name) name_count
    FROM userapps u
GROUP BY activity_class

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM