group by clause

Jason FU tsfu at HKUCS.ORG
Mon Aug 15 19:35:03 PDT 2005


What do I do for the sql statement as follows:

select the_geom from  sounding.sdgonly_20050722point
where elevation > 0 and mod(gid, 300) = 1
group by the_geom
having max(dispx) > 86738

?

================================================================

CREATE TABLE sounding.sdgonly_20050722point
(
  gid serial NOT NULL,
  recno int8,
  elevation float8,
  dataflags int8,
  dispx float8,
  dispy float8,
  size float8,
  angle float8,
  scale int8,
  keyword varchar,
  usernum int8,
  fcode varchar,
  datatype int4,
  descflags int8,
  themenum int8,
  indexkey varchar,
  superflags int8,
  sourceid varchar,
  the_geom geometry,
  CONSTRAINT sdgonly_20050722point_pkey PRIMARY KEY (gid),
  CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2),
  CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) =
'POINT'::text OR the_geom IS NULL),
  CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = -1)
)
WITH OIDS;
================================================================
I tried this one in MapServer but it doesn't work at all.

  DATA "the_geom from sounding.sdgonly_20050722point"
  FILTER " (elevation > 0 and mod(gid, 300) = 1) # group by the_geom "

Please advise.

Thanks.

Jason



More information about the MapServer-users mailing list