Thank you Moritz, that works perfect! BTW, I saw that you can also write: $( ......) instead of `...` The result seems to be equivalent. patrick On 03/15/2012 10:03 AM, Moritz Lennert wrote: > > v.category in=gr_help1 out=gr_help1_cat option=sum value=`echo 'SELECT > MAX(cat) FROM gr_help1' | db.select -c`