我正在尝试编辑此查询:
SELECT (WEEKDAY( date ) +1) dayofweek, COUNT( * ) count
FROM abanners
WHERE iid = ? AND banner LIKE ?
GROUP BY (WEEKDAY( date ) +1)
ORDER BY count DESC
通过这个查询,我得到了按星期几分割的条目数,但是如果我需要同样的东西也分割banner
呢?
所以我想拥有:
banner1: entries splitted by day of week
banner2: entries splitted by day of week
ex: {"banner1" : "1,3,4,1,3,5,1", "banner2": "1,3,4,1,3,5,1"}
我能怎么做?