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)
 Help me with this Join

Author  Topic 

wisdomtree2009
Starting Member

5 Posts

Posted - 2008-12-25 : 03:04:29
Hi Can any one tell me whats the mistake i am doing in this piece of SQL . I have tried quite a few times to make it error free but still it is thorwing error 'Not a group by clause'

select count(s1.prod_line_desc),s1.grp_channel_nm from
(

select t3.prod_line_desc,t1.grp_channel_nm ,t2.prod_key
from
machine_analysis_fct t2
inner join
prod_dim t3
on
t3.prod_key = t2.prod_key
inner join
grp_channel_dim t1
on
t1.grp_channel_key=t2.grp_channel_key
group by t1.grp_channel_nm

) s1

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2008-12-25 : 03:29:55
select count(s1.prod_line_desc),s1.grp_channel_nm from
(

select t3.prod_line_desc,t1.grp_channel_nm ,t2.prod_key
from
machine_analysis_fct t2
inner join
prod_dim t3
on
t3.prod_key = t2.prod_key
inner join
grp_channel_dim t1
on
t1.grp_channel_key=t2.grp_channel_key
group by t1.grp_channel_nm

) s1
group by s1.grp_channel_nm
Go to Top of Page

xpandre
Posting Yak Master

212 Posts

Posted - 2008-12-25 : 03:30:12
I think it should be..
select count(s1.prod_line_desc),s1.grp_channel_nm from
(

select t3.prod_line_desc,t1.grp_channel_nm ,t2.prod_key
from
machine_analysis_fct t2
inner join
prod_dim t3
on
t3.prod_key = t2.prod_key
inner join
grp_channel_dim t1
on
t1.grp_channel_key=t2.grp_channel_key
) s1
group by s1.grp_channel_nm
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2008-12-25 : 03:43:23
ohhh xpandre by a minute.........
Go to Top of Page
   

- Advertisement -