我想执行查询mysql并将结果转换为
之类的json这是我正在使用的查询:
listin %>% group_by(title, Action_updated=="Registration") %>% summarise(Count = n()) %>% ungroup() %>% mutate(Action_updated = "InsinuatedRegistered")
这就是我想要的结构,可以通过任何方式实现
期望的JSON:
SELECT
c.state_id,
s.name,
u.city_id,
c.name,
COUNT(u.id)
FROM
user u
INNER JOIN
cities c ON c.id = u.city_id
INNER JOIN
states s ON s.id = c.state_id
GROUP BY c.state_id, u.city_id;
我有mysql版本5.7