Well, I would use the first selected I posted.
If you need special formating of output, you can still use
or something like that.
But I would still rather have trunc(date,'mm') in group by.
I believe for big orders table this sort would be faster than
select to_char(date,'yyyy'), to_char(date,'mm'), customer, count(*)
group by to_char(date,'yyyy'), to_char(date,'mm'), customer
while it will give you the same result.
Maybe I am wrong - after all, it's just a feeling.
I am sure abhaysk will be happy to test my assumptions.
Tomaž "A common mistake that people make when trying to design something completely
foolproof is to underestimate the ingenuity of complete fools" - Douglas Adams