我正在尝试根据别名表中查询结果中给出的值来设置列的结果
select b.* from table1 a, table1 b where a.empno=99 and a.super_empno = b.empno;
答案 0 :(得分:0)
您没有为IN语句指定一个字段。您应该具有一个字段名称,以便与select语句进行比较。看起来像WHERE field_name IN (SELECT .....)
答案 1 :(得分:0)
您可以在hading子句中重复聚合表达式:
update autos
set risico = 0
where in (select leden.lidnaam, count(deelnemers.evenementnr) as AantalDeelnames
from leden
full join autos on leden.lidnr = autos.lidnr
full join deelnemers on autos.autonr = deelnemers.autonr
group by leden.lidnaam
having count(deelnemers.evenementnr) = 0)