From 67f514a15c8e779dfc7e7c6a724cbe3642bbec0d Mon Sep 17 00:00:00 2001 From: Kiritow <1362050620@qq.com> Date: Sun, 17 Sep 2017 20:37:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'2.5.cpp'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2.5.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/2.5.cpp b/2.5.cpp index a58f6f1..6e81da2 100644 --- a/2.5.cpp +++ b/2.5.cpp @@ -44,6 +44,17 @@ int main() }); }); + conn.exec("use bigdata5",nullptr); + conn.exec("select job_city,count(*) from pages where ( title like '%大数据%' ) 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.5.csv"); for(auto iter=mp.begin();iter!=mp.end(); ) @@ -76,6 +87,7 @@ int main() #define cout ofs + cout<<"城市,大数据岗位数量"<