我有一个有效的 mysql 查询:
SELECT COUNT(*), c.description
FROM name_loc f
INNER JOIN countries c ON f.fk_cnty_id = c.id
INNER JOIN identifiers i ON f.fk_ident_id = i.id
GROUP BY f.fk_cnty_id;
它返回:
+------+----------------+
| cnt | description |
+------+----------------+
| 1093 | AUSTRALIA |
| 235 | BELGIUM |
| 474 | BERMUDA |
我需要一个语句,允许我绘制一个直方图,其中垂直轴是计数,水平轴是县。
我认为这会起作用:
totalCntLByCnty = {#[[1, 2]], #[[2]]} & /@ SQLExecute[conn, "
SELECT COUNT(*), c.description
FROM name_loc f
INNER JOIN countries c ON f.fk_cnty_id = c.id
INNER JOIN identifiers i ON f.fk_ident_id = i.id
GROUP BY f.fk_cnty_id
"]
我收到此错误:
Part::partd: Part specification {2,ANDORRA}[[1,2]] is longer than depth of object. >>
然后我需要绘制直方图。我已经为此花了一个小时,所以任何帮助将不胜感激。