From: | Christine Penner <christine(at)ingenioussoftware(dot)com> |
---|---|
To: | Richard Broersma <richard(dot)broersma(at)gmail(dot)com> |
Cc: | Postgres-General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Simple function |
Date: | 2009-12-23 18:00:26 |
Message-ID: | 19740413173256.45D1B1E12F8D1DB8@edtnaa02.telusplanet.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Thanks a lot, that worked great. Saved me a lot of time trying to
figure it out too.
Christine
>It works for me:
>
>postgres=# CREATE OR REPLACE FUNCTION countertest(integer) RETURNS
>bigint AS $$ SELECT COUNT(*) FROM test WHERE nbr = $1; $$ LANGUAGE
>SQL;
>CREATE FUNCTION
>postgres=# select countertest(24);
> countertest
>-------------
> 1
>(1 row)
>
>
>http://www.postgresql.org/docs/8.4/interactive/xfunc-sql.html
>
>
>--
>Regards,
>Richard Broersma Jr.
>
>Visit the Los Angeles PostgreSQL Users Group (LAPUG)
>http://pugs.postgresql.org/lapug
From | Date | Subject | |
---|---|---|---|
Next Message | Andy Shellam | 2009-12-23 19:02:15 | Re: How to add month.year column validation |
Previous Message | Rajan, Pavithra | 2009-12-23 17:15:55 | How to get a list of tables that have a particular column value? |