Re: [sqlite] Parentheses in column name

2014-12-23 Thread Stephan Beal
On Mon, Dec 22, 2014 at 9:19 PM, Federico Jurio <
federicoju...@suremptec.com.ar> wrote:

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

You're using double quotes inside double quotes, which cannot parse how you
expect it to. You need to change the outer quotes (around the whole select)
to single quotes, then use double quotes around "(asd*)" (as you've done).
Alternately, i believe '[' and ']' can be used instead of quotes around
table/field names.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Parentheses in column name

2014-12-23 Thread RSmith


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


[sqlite] Parentheses in column name

2014-12-23 Thread Federico Jurio
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
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

Can someone help me with the correct expression?
Thanks in advance!

Regards

-- 
Federico Jurio
SUR Emprendimientos Tecnológicos

Perú 345  Piso 5to Oficina "B" (C1067AAG)
Ciudad de Buenos Aires, Argentina
Tel. +54 (11) 4342-2976/84
federicoju...@suremptec.com.ar
www.suremptec.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users