qq_31472377
qq_31472377
2017-10-12 02:33

报错Unknown column 'u.u_id' in 'where clause'

2
  • sql

我的sql语句是:
SELECT COUNT(*) FROM wujiuser u WHERE
(SELECT MAX(days) FROM
(SELECT
@con :=(CASE WHEN ( dd = 0 OR dd = @con) THEN (@con + 1)ELSE 0 END) AS days,
dd FROM
(SELECT DATEDIFF(NOW(),t.logintime) AS dd FROM login_record t WHERE t.u_id=u.u_id ORDER BY t.logintime DESC) AS vv GROUP BY dd) AS v1)>=3

出现报错信息:Unknown column 'u.u_id' in 'where clause'

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

4条回答