Does ogrinfo
support a GROUP BY clauses? I could not find any good documentation of all the SQL syntax features it supports.
I tried the following:
ogrinfo . -geom=no -sql 'SELECT lsad FROM tl_2011_us_county GROUP BY lsad'
And got the following error:
ERROR 1: SQL: Failed to parse SELECT statement, extra input at BY token.
INFO: Open of `.'
using driver `ESRI Shapefile' successful.
What I really want to do:
SELECT lsad, count(*)
FROM tl_2011_us_county
GROUP BY lsad
What I can do:
SELECT DISTINCT lsad
FROM tl_2011_us_county
And then:
SELECT count(*)
FROM tl_2011_us_county
WHERE lsad = 'foo'
... but that is annoying.