On 2014/12/22 22:19, Federico Jurio wrote:
Hi guys, i'm trying to make a simple query using sqlite through gdal
library ( http://www.gdal.org/ogr_sql.html )

I have a simple table with two columns: ID and (asd*) (both columns have
integer values)

I want the minimun value of this columns

My first attempt was successful

E:\Pruebas>ogrinfo -sql "select min(id) MINID from Geo1" Geo1.shp
INFO: Open of `Geo1.shp'
       using driver `ESRI Shapefile' successful.

Layer name: Geo1
Geometry: None
Feature Count: 1
Layer SRS WKT:
(unknown)
MINID: Integer (10.0)
OGRFeature(Geo1):0
   MINID (Integer) = 2

My second attempt was unsuccessful

E:\Pruebas>ogrinfo -sql "select min((asd*)) MINASD from Geo1" Geo1.shp
INFO: Open of `Geo1.shp'
       using driver `ESRI Shapefile' successful.
ERROR 1: SQL Expression Parsing Error: syntax error, unexpected ')'.
Occured around :
select min((asd*)) MINASD from Geo1

E:\Pruebas>ogrinfo -sql "select min(""(asd*)"") MINASD from Geo1" Geo1.shp

Should fix it.


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to