if-clause to an exiting statement

From: Kobi Biton <kobi(at)comns(dot)co(dot)il>
To: pgsql-general(at)postgresql(dot)org
Subject: if-clause to an exiting statement
Date: 2010-12-07 09:19:53
Message-ID: 1291713593.2075.64.camel@kbiton-lap-ub
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 &gt; now() - interval '10 minutes')
----------------------------------------------------------------------------------

Thanks!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Grzegorz Jaśkiewicz 2010-12-07 10:13:41 Re: if-clause to an exiting statement
Previous Message Kalai R 2010-12-07 08:12:08 Implement online database using Postgresql