select groups.*, 
<@PROCESS@>&select  ifnull( max(attr_id)+ 1,1) from <@PREFIX@>attr ## NEXTID

  from groups where 
groups.WGROUPID = <@KEY@> 

