user2560828
user2560828

Reputation: 1

Can I Add SQL QUERY in EXPRESSION MAPFILE?

Can I Add SQL QUERY in EXPRESSION MAPFILE ? like this ..

CLASS
Name '> 0'
EXPRESSION (SELECT * from tb_kelurahan where id_kecamatan='[id_kecamatan]' > 0)
COLOR 20 215 0
OUTLINECOLOR 0 0 0

END # Class

Upvotes: 0

Views: 287

Answers (1)

Stephen Woodbridge
Stephen Woodbridge

Reputation: 1110

No. But as an alternative you can add the sql as an additional column to the DATA statement and then reference that in the expression.

DATA "the_geom from (select case when id_kecamatan>0 then 1 else 0 end as myexpress, the_geom, ...) as foo ...."

and then use:

EXPRESSION ([myexpress] = 1)

Upvotes: 2

Related Questions