conditional FROM - Mailing list pgsql-sql

From Richard Klingler
Subject conditional FROM
Date
Msg-id 20111210170332479879.3df30525@klingler.net
Whole thread Raw
Responses Re: conditional FROM
Re: conditional FROM
Re: conditional FROM
List pgsql-sql
Good day...

I'm trying to build a query for PGSQL 9.1 where a table has two 
references with only one being used depending of the type of entry..

For example, the table has following simplified structure:
portid        primary keyport2node    index to table nodeport2card    index to table card

So how can I do a conditional FROM clause in the query depending on the 
column port2node and port2card?
If port2card is Null or 0 I don't want it in the FROM clause as the 
query will return unneccessary duplicate
row...the same goes for port2node being Null or 0...


thanx in advance
richard



pgsql-sql by date:

Previous
From: "Emre Hasegeli"
Date:
Subject: Re: Question on imports with foreign keys
Next
From: Andreas Kretschmer
Date:
Subject: Re: conditional FROM