在ubuntu上使用mysql
以下命令未按降序排序
mysql> select spo_id, count(spo_id) as "maxCount" from order_details GROUP BY spo_id ORDER BY "maxCount" DESC;
+--------+----------+
| spo_id | maxCount |
+--------+----------+
| 1 | 1 |
| 2 | 3 |
| 3 | 1 |
+--------+----------+
3 rows in set (0.00 sec)
答案 0 :(得分:2)
MySQL允许使用双引号的字符串文字。因此,当您按" maxCount"进行订购时,您实际上是按字符串文字排序,这只是毫无意义。删除引号,它应该工作正常:
String.endsWith(searchString, position)