我有一个看起来像这样的表:
列标有ptime,数量和销售额。
"2015-10-15 9:50:09" "2" "6"
"2015-10-4 10:24:48" "3" "9"
"2015-10-8 12:45:46" "5" "15"
"2015-10-8 9:50:09" "3" "9"
"2015-10-8 10:24:48" "1" "3"
"2015-10-9 12:45:46" "2" "6"
"2015-10-20 12:45:46" "2" "8"
"2015-10-2 23:45:52" "2" "6"
"2015-10-8 15:21:23" "3" "9"
"2015-10-12 21:31:47" "2" "6"
"2015-9-6 12:50:09" "1" "3"
"2015-9-15 16:38:21" "1" "3"
"2015-9-2 23:45:52" "1" "3"
"2015-9-8 15:21:23" "1" "3"
我使用以下代码按月和年汇总销售额:
sum(SalesAmount) as SalesMonth,
strftime("%m-%Y", ptime) as 'month-year'
from Sales
group by strftime("%m-%Y", ptime);
然而,我得到的结果显示
"81" "NULL"
"14" "10-2015"
这不是九月和十月的正确数额。
非常感谢任何帮助。
感谢。
答案 0 :(得分:0)
.grid-thumbnail {
overflow: hidden;
width: 20%;
height: 0;
padding-bottom: 20%;
}
不起作用,因为您没有使用其中一个supported date formats;所有字段必须填充为两位数。