BUG: CREATE VIEW Fails with Message 8120Last reviewed: July 30, 1997Article ID: Q171869 |
The information in this article applies to:
SYMPTOMSA CREATE VIEW statement may fail to create the view, and cause message 8120:
Column is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.This problem occurs if all of the following conditions are true:
create view viewname as select 'x'=substring(x,1,1) from tbl1 a where a.y=(select max(y) from tbl1 where y = a.y) group by substring(x,1,1) WORKAROUNDTo work around this problem, do either of the following:
STATUSMicrosoft has confirmed this to be a problem in Microsoft SQL Server version 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONThe SELECT statement works fine outside of the view. The GROUP BY clause, as documented, should accept any aggregate free expression. This problem does not occur on SQL Server build 6.5.201. Keywords : kbbug6.50 SSrvBCP SSrvGen kbusage Version : 6.5 Platform : WINDOWS Issue type : kbbug Solution Type : kbworkaround |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |