Search Postgresql Archives

if-clause to an exiting statement

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

 



hi i am a newbie to sql statments  , I am running postgres 8.1 with
application called opennms version 1.8.5 due to an application bug
queries that I execute aginst the DB which returns raw-count=0 are being
ignored and will not process a certain trigger I need to process.

My question is :  Can I use an if-clause into my statement (see below)
which will check if the returned raw-count =0 then will return
raw-count=1 ?
----------------------------------------------------------------------------------
SELECT a.eventuei AS _eventuei,
                 a.nodeid AS _nodeid,
                 a.ipaddr AS _ipaddr,
                 now() AS _ts
            FROM events a
                WHERE
a.eventuei='uei.opennms.org/comns/backup-success-trap' AND
                (eventcreatetime > now() - interval '10 minutes')
----------------------------------------------------------------------------------

Thanks!


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