更新 '2.3.cpp'
This commit is contained in:
parent
74cefd867a
commit
4b0eed8e40
11
2.3.cpp
11
2.3.cpp
@ -42,6 +42,17 @@ int main()
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
conn.exec("use bigdata2",nullptr);
|
||||||
|
conn.exec("select job_city,count(*) from pages group by job_city",[&](MySQLResult& res)
|
||||||
|
{
|
||||||
|
res.stepRow([&](char** val,unsigned long* len)
|
||||||
|
{
|
||||||
|
string city(val[0]);
|
||||||
|
int cc=ParseInt(val[1]);
|
||||||
|
mp[Trim(city)].push_back(cc);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
ofstream ofs("result/2.3.csv");
|
ofstream ofs("result/2.3.csv");
|
||||||
|
|
||||||
for(auto iter=mp.begin();iter!=mp.end(); )
|
for(auto iter=mp.begin();iter!=mp.end(); )
|
||||||
|
Reference in New Issue
Block a user