问下高手下面的这个配置
<select id="countweek" resultType="map">
SELECT DATE(tl.`createtime`) createtime, COUNT(*) number
FROM tb_take_log tl
WHERE tl.createtime BETWEEN DATE_SUB(DATE(NOW()),INTERVAL 1 WEEK) AND DATE(NOW())
GROUP BY DATE(tl.`createtime`)
</select>
按这个查出来以后是:
[{createtime=2013-09-03, number=1, CREATETIME=2013-09-03, NUMBER=1}, {createtime=2013-09-04, number=6, CREATETIME=2013-09-04, NUMBER=6}]
这种的,如果想去掉后面的重复的那个CREATETIME=2013-09-03, NUMBER=1,只留前面的该怎么配置一下。
<select id="countweek" resultType="map">
SELECT DATE(tl.`createtime`) createtime, COUNT(*) number
FROM tb_take_log tl
WHERE tl.createtime BETWEEN DATE_SUB(DATE(NOW()),INTERVAL 1 WEEK) AND DATE(NOW())
GROUP BY DATE(tl.`createtime`)
</select>
按这个查出来以后是:
[{createtime=2013-09-03, number=1, CREATETIME=2013-09-03, NUMBER=1}, {createtime=2013-09-04, number=6, CREATETIME=2013-09-04, NUMBER=6}]
这种的,如果想去掉后面的重复的那个CREATETIME=2013-09-03, NUMBER=1,只留前面的该怎么配置一下。