diff --git a/2.3.cpp b/2.3.cpp index b4733e7..2efbb00 100644 --- a/2.3.cpp +++ b/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"); for(auto iter=mp.begin();iter!=mp.end(); )