Ticket #3726 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

OGR SQL Engine doesn't support "SELECT COUNT(DISTINCT foo) FROM bar"

Reported by: rouault Owned by: warmerdam
Priority: normal Milestone: 1.8.0
Component: OGR_SF Version: unspecified
Severity: normal Keywords: rfc28
Cc:

Description

For example,

ogrinfo ../autotest/ogr/data/poly.shp -sql "SELECT COUNT(DISTINCT eas_id) FROM poly"

returns :

ERROR 1: SQL Expression Parsing Error: syntax error

but "SELECT DISTINCT eas_id FROM poly" works

Change History

Changed 3 years ago by warmerdam

  • status changed from new to closed
  • resolution set to fixed

Fixed with a fairy specific case for COUNT(DISTINCT fieldname) in trunk (r20327). I also fixed a problem where AS aliases could not be quoted strings.

Note: See TracTickets for help on using tickets.