Search Postgresql Archives

Re: Query and the number of row result

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

 



bilal ghayyad <bilmar_gh@xxxxxxxxx> wrote:

> I am talking in case I am writing a script for a function,
> and I need to know the number of the returned rows of the
> query, then I will do IF statement based on that number,
> how?
> [...]

Presuming that you are talking about a function written in
PL/pgSQL, you will have to count them yourself or issue a
second query "SELECT COUNT(*) FROM [...]". For the special
case that you want to find out whether no row at all was
found, you can look at "IF (NOT) FOUND".

Tim


-- 
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