Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Count not displaying properly

Author  Topic 

fubuki99
Starting Member

10 Posts

Posted - 2009-05-03 : 23:50:20
Hello,

I'm getting error "invalid column name count" when I try to count the value from a column and return the output that is more than 2 from the below statement. How do I get this result to return the output?


select cos, count(*)as total
from acfbs_cos
where count >2


Msg 207, Level 16, State 1, Line 2
Invalid column name 'count'.

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2009-05-03 : 23:58:16
You can't use count as a column name....Can't say much without seeing sample data...but maybe this..

SELECT cos,COUNT(cos) FROM acfbc_cos
GROUP BY cos
HAVING COUNT(cos) > 2
Go to Top of Page
   

- Advertisement -