I have a table of data for a particular stock that contains every single transaction going back a few years. I want to group this data on a per-day basis, so that I can see things like the daily volume, etc.
The best way I have come up with so far is:
select
datepart(year, date),
datepart(month, date),
datepart(day, date),
sum(volume) from hi
group by
datepart(year, date),
datepart(month, date),
datepart(day, date)
order by
datepart(year, date),
datepart(month, date),
datepart(day, date)
My SQL is somewhat limited, so I'm wondering if there's a more efficient way to do this?