[GRASS-user] v.patch
Moritz Lennert
mlennert at club.worldonline.be
Thu Mar 15 05:03:48 EDT 2012
On 14/03/12 19:19, Patrick S. wrote:
> Is there some possibility to do s.th as:
> v.category in=gr_help1 out=gr_help1_cat option=sum value="echo 'SELECT
> MAX(cat) FROM gr_help1' | db.select"
>
If you're on a *nix command line, you can do this:
v.category in=gr_help1 out=gr_help1_cat option=sum value=`echo 'SELECT
MAX(cat) FROM gr_help1' | db.select -c`
i.e. use backticks instead of quotes and the -c flag of db.select to
make sure that the output is only one value, without column names.
And IIRC you have to use an SQL-backend, i.e. not dbf, for max() to work.
Moritz
More information about the grass-user
mailing list