group by and having Clauses and Sort Orders

If your server has a case-insensitive sort order, group by ignores the case of the grouping columns.

For example, given this data on a case-insensitive server:
select lname, amount 
from groupdemo
lname           amount 
---------- ------------------ 
Smith                10.00 
smith                 5.00 
SMITH                 7.00 
Levi                  9.00 
Lévi                 20.00
grouping by lname produces these results:
select lname, sum (amount)
from groupdemo
lname 
---------- ---------------- 
Levi                  9.00
Lévi                 20.00
Smith                22.00
The same query on a case- and accent-insensitive server produces these results:
 lname 
 ---------- ------------------ 
 Levi                  29.00 
 Smith                 22.00