我想计数的结果赋值给一个变量,这样我就可以在随后的查询中使用它,这里是我的代码:为什么在这个查询中有无效的标识符?
select distinct(Artist), count(distinct(Instrument)) as allins
from performers
where allins = (select count(distinct(x.Instrument))
from performers x)
group by Artist;
错误:ORA-00904: "ALLINS": invalid identifier
[在WHERE子句中使用别名]可能的重复(http://stackoverflow.com/questions/356675/using-an-alias-in-a-where-clause) – 2014-09-22 00:07:35