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 working?

Author  Topic 

jgonzalez14
Yak Posting Veteran

73 Posts

Posted - 2008-11-08 : 23:12:04
Can someone tell me what i am doing wrong here?

Select count(cc.language) as language, c.name
from Country c
Inner Join
CountryLanguage cc
on
c.Code = cc.CountryCode
where cc.language > 10
group by cc.language;


It seems the 'where' statement is making it error. W/o the where statement it works; however, when I put the where in it does not.

Thanks

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-11-08 : 23:36:09
quote:
Originally posted by jgonzalez14

Can someone tell me what i am doing wrong here?

Select count(cc.language) as language, c.name
from Country c
Inner Join
CountryLanguage cc
on c.Code = cc.CountryCode
group by c.name
having count(cc.language)>10
;

It seems the 'where' statement is making it error. W/o the where statement it works; however, when I put the where in it does not.

Thanks

Go to Top of Page

jgonzalez14
Yak Posting Veteran

73 Posts

Posted - 2008-11-08 : 23:51:40
Works Perfect Thanks!!!!
Go to Top of Page
   

- Advertisement -