Helper aggregate function - Mailing list pgsql-sql

From sergey kapustin
Subject Helper aggregate function
Date
Msg-id cf82f1380802030344x10138291ob685533ef4b5a4c8@mail.gmail.com
Whole thread Raw
Responses Re: Helper aggregate function
List pgsql-sql
Hello!<br />Can anyone tell me how i do this properly?<br /><br />create or replace function agg(varchar,varchar)
returnsvoid as $func$<br />        select $1,count(*) from $2 group by $1 order by $1;<br />$func$<br />Language
SQL;<br/><br />Right now this wives me "ERROR:  syntax error at or near "$2" at character 97 <br />select $1,count(*)
from$2 group by $1 order by $1;"<br /><br />Thank you!<br /><br /><br /><br /> 

pgsql-sql by date:

Previous
From: "Jonah H. Harris"
Date:
Subject: Re: can a insert with a returning clause be subquery ?
Next
From: "Robins Tharakan"
Date:
Subject: Re: Helper aggregate function