我想計數的結果賦值給一個變量,這樣我就可以在隨後的查詢中使用它,這裏是我的代碼:爲什麼在這個查詢中有無效的標識符?
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