[GRASS-user] occurrence of attributes in vektortable

Moritz Lennert mlennert at club.worldonline.be
Thu Mar 20 17:12:17 EDT 2008


On 07/03/08 19:42, Nikos Alexandris wrote:
> On Fri, 2008-03-07 at 10:20 -0700, Tom Russo wrote:
>> On Fri, Mar 07, 2008 at 03:35:17PM +0100, we recorded a bogon-computron collision of the <nikos.alexandris at felis.uni-freiburg.de> flavor, containing:
>  
> [...]
> 
> So we end up with (in my example using the table "TrainingSamples" and
> the column "clccode_le"):
> 
> v.db.select -c map=TrainingSamples column=clccode_le | sort -u
> 
> Still,
> I think it's necessary to give a multiplatform solution (meaning a
> solution which works for wingrass as well). So an SQL query should be it
> as far as I understand.

If you use a real SQL backend:

echo "select distinct(ColumnName) from TableName" | db.select

If you want to count the amount of occurences:

echo "select distinct(ColumnName) as ame, count(*) from TableName group 
by name" | db.select

Moritz


More information about the grass-user mailing list