Search Postgresql Archives

Re: Simple function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux