I have a table with records that look like this (for example):
ID Store Item Date Name
1 Safeway Milk 20060481141945 Max
2 Safeway Eggs 20060481141958 Max
3 Vons Milk 20060481141818 Joe
4 Vons Eggs 20060481141822 Joe
5 Vons Bread 20060481141830 Joe
6 Vons Lettuce 20060481141831 Joe
7 Safeway Milk 20060481141713 Bob
8 Safeway Candy 20060481141722 Bob
9 Vons Butter 20060481141833 Joe
10 Safeway Cheese 20060481141834 Sam
I want to accomplish the following:
(1) Determine the first item purchased according to the timestamp per person (i.e., ID# 1, ID# 3, ID# 7, and ID #10)
(2) Tally those results by store so that ultimately, I'm outputting:
Store Count
Safeway 3
Vons 1
Can I do this all via query? Or, is PHP necessary? And if so, can someone show how to do this?