我有(來自imdb數據庫)casts
表和movie
表。我試圖找到最大的演員(不同的演員)的電影名稱和演員的大小。SQL Server'無效列名'錯誤
這是我想出了,但我得到的 「TOTALCOUNT」
爲什麼一個
「無效列名」 的錯誤?
此外,此查詢是否正確?
select name, count(distinct pid) as totalcount from casts join movie on mid=movie.id where totalcount = (select max(CastCount.total) from (select count(distinct pid) as total from casts group by mid)CastCount) group by name;
是MySQL還是SQL Server問題?請爲您的問題使用正確的標籤。 – Mchl 2012-02-03 22:08:44
我的印象是,mssql服務器使用mysql。沒有? – Colleen 2012-02-03 22:12:08
編號MSSQL服務器是另一種與MySQL幾乎沒有共同之處的產品(除了事實,它們都是SQL關係數據庫管理系統) – Mchl 2012-02-03 22:13:10