如一张表里数据如下
statedate statehour hrtimes
2011-12-27 10 10
2011-12-27 16 22
2011-12-27 17 3
2011-12-28 10 33
2011-12-28 14 5
如何将这两天的数据并在一起,成为
statehour hrtimes
10 43
14 5
16 22
17 3
这里statehour 如相同的话就将它加在一起。这个sql语句怎么写呢?
statedate statehour hrtimes
2011-12-27 10 10
2011-12-27 16 22
2011-12-27 17 3
2011-12-28 10 33
2011-12-28 14 5
如何将这两天的数据并在一起,成为
statehour hrtimes
10 43
14 5
16 22
17 3
这里statehour 如相同的话就将它加在一起。这个sql语句怎么写呢?
from 如一张表
Group by statehour