S
sdtrm
Unregistered / Unconfirmed
GUEST, unregistred user!
我有一张表,如下结构...<br>id name time<br>1 a 2008-9-5 0:02:02<br>2 b 2008-9-6 1:01:01<br>3 c 2008-9-7 1:01:01<br>4 d 2008-9-5 1:01:01<br>5 a 2008-9-5 0:02:01<br>6 e 2008-9-5 1:02:01<br><br>想得出两种结果<br>一个为按日期对name进行分组,计算出每一天内name出现的次数<br>name namecount time<br>a 2 2008-9-5<br>b 1 2008-9-6 <br>c 1 2008-9-7 <br>d 1 2008-9-5 <br>e 1 2008-9-5<br>一个为按小时对name进行分组,计算出一天内每一小时name出现的次数<br>name namecount time<br>a 2 2008-9-5 0<br>d 1 2008-9-5 1<br>e 1 2008-9-5 1