[mapserver-users] select one column values from a table

Paolo Corti pcorti at gmail.com
Tue May 19 03:39:11 PDT 2009




hi friend...thanks for ur response...
let me desribe my requirement in detail...
i have one table n_123 and in that table i have 2 columns PLO_900,PLO_901.

PLO_900   PLO_900 
af                  op_1
3f                  op_2
h7                 op_3

i need the result like as follows
af                  
3f                 
h7 

that means all the values from the first column....the specified code u
mentioned  giving me only one record....can u help me ?



Basically you have 2 ways:

1) like in my sample code, iterate all the features and access the field
values with layer.getItem(i)

2) much better for performance and if your layer is in a spatial database:
do a select distinct. If for example you are using PostGis from .NET use the
postgres driver (npgsql: http://npgsql.projects.postgresql.org/) and with a
sqlcommand use this commandtext: select distinct(yourfield) from yourtable

best regards
Paolo


   

-- 
View this message in context: http://n2.nabble.com/select-one-column-values-from-a-table-tp2931342p2938771.html
Sent from the Mapserver - User mailing list archive at Nabble.com.




More information about the MapServer-users mailing list