求助,下面的sql mariadb报错,mysql8.0不报错
sql吧
全部回复
仅看楼主
level 1
心机黑boy 楼主
SELECT u.id FROM rtv_user u
WHERE u.`rank`!=0 AND u.status!=2 and u.device='console'
and not EXISTS(select 1 from
(select count(*) as cnt from
(select * from rtv_console_unit_mapping cum where cum.console_id=u.id) cum1,
(select unt.unique_id from rtv_unit_table unt,rtv_user ru
where unt.corp_id=ru.corp_id and unt.state!=2
and unt.id=ru.department_fk_id
and ru.id=65540
) udpt where cum1.dept_unique_id= udpt.unique_id
) as cum2
where cum2.cnt>0
)
执行之后报Unknown column 'u.id' in 'where clause',有什么转换的方式吗
2023年12月14日 09点12分 1
level 1
你这提示的不是未知字段?你确定你这个表有id这个字段吗?
2023年12月19日 00点12分 2
1