Opened 14 years ago

Closed 14 years ago

#3726 closed defect (fixed)

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

Reported by: Even 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 (1)

comment:1 by warmerdam, 14 years ago

Resolution: fixed
Status: newclosed

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.