Query execution based on a condition

From: JORGE MALDONADO <jorgemal1960(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Query execution based on a condition
Date: 2012-12-29 19:05:35
Message-ID: CAAY=A79=a3jPonSK9pHvVvS6QAFQdLZdKWAkkQj+bVdPB-GCNw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I have a query similar to the one shown below but, depending on the value
of a field, only the first SELECT statement shoud execute and the other 3
should be ignored. Is there a way to achieve this situation?

SELECT fields FROM tblTable WHERE condition
UNION
SELECT fields FROM tblTable WHERE condition
UNION
SELECT fields FROM tblTable WHERE condition
UNION
SELECT fields FROM tblTable WHERE condition

Respectfully,
Jorge Maldonado

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message David Johnston 2012-12-29 19:23:35 Re: Query execution based on a condition
Previous Message johnmethew 2012-12-28 23:11:13 Re: Find Out a Way to Recover Data From Android Phone