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 2000 Forums
 SQL Server Development (2000)
 ROLLUP bug?

Author  Topic 

SamC
White Water Yakist

3467 Posts

Posted - 2004-08-06 : 14:12:43
This one caught me in the ribs today.

select	centername, count(*) as total
from centers c
inner join users u
on c.centerid = u.centerid
where centername like 'ac%'
group by centername with rollup
having count(*) > 29
order by centername


Try this with your own data. Adjust the HAVING clause to eliminate a couple of rows.

The grand total calculated by ROLLUP stays the same, no matter how many rows are eliminated by the HAVING clause.

Sam

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2004-08-06 : 16:20:01
I'm feeling so lazy today (hmmm, could it be friday?) that I don't have the energy to create my own test case. damn.



-ec
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2004-08-06 : 16:41:39
It's a
Go to Top of Page
   

- Advertisement -