Mysql查询错误1111 - 无效使用组功能

时间:2018-01-23 03:52:06

标签: mysql

 SELECT
     count( * ) 
 FROM
    `tp_2018-01` 
 WHERE
     SUBSTRING( scan_date, 1, 10 ) BETWEEN MIN( CAST( SUBSTRING( scan_date, 1, 10 ) AS DATE ) ) 
     AND MAX( CAST( SUBSTRING( scan_date, 1, 10 ) AS DATE ) ) 
     AND nip = '1060001'

并返回此类错误

 > 1111 - Invalid use of group function
 > Time: 0,018s

这是我的表结构

 _____________________________
 | id | scan_date | sn | nip | 
 -----------------------------

我只是坚持这个问题。

0 个答案:

没有答案