Keith,
Thank you very much. This information is most helpful.
Chad
>Chad,
>
>It doesn't matter whether @date is added to the GROUP BY or not. The optimizer will ignore it because it is a constant. Whether to add an ORDER BY clause is difficult to answer without the specifics of table height/width, indexes, fill factor on clustered index, index fragmentation, etc. The best that you can do is examine execution plans and try changes to see if there are improvements.
>
>Assuming that this query will be executed a large number of times throughout the lifetime of the system, it is a good example of an item that a DBA will evaluate regularly and re-optimize to keep the performance high as the nature of the database and environment changes.
_________________________________
There are 2 types of people in the world: