信不信由你,当我搜索这个时,我想出了 nada。
如何按“列”之一对 svector
的多维进行排序?int
提前谢谢了!
C++
res = mysql_perform_query(conn, "SELECT column1, column2, column3 FROM table1;");
std::vector< std::vector< int > > myVector;
while ((row = mysql_fetch_row(res)) !=NULL){
int rankedID = atoi(row[0]);
std::vector< int > tempRow;
tempRow.push_back(atoi(row[0]));
tempRow.push_back(atoi(row[1]));
tempRow.push_back(atoi(row[2]));
myVector.push_back(tempRow);
}
我想myVector
按myVector[i][1]
降序排序。
再次感谢!