Reg: Sql Join

From: CrashBandi <crashbandicootu(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Reg: Sql Join
Date: 2014-07-30 22:08:18
Message-ID: CAAvgTTT02zxdRzfcFiq+V-zDQzcOUNrsQGSLNsi2Xc02kuygKg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I am having the following question. I am not sure how to approach it.
Please help!

table A
name col1 col2 col3 col4 apple 100 11111 1 APL orange 200 22222 3 ORG
carrot 300 33333 3 CRT

table B
custom_name value obj_type obj_id apple a FR 100 orange o FR 200 carrot
c VG 300 apple d FR 11111 orange e VG 22222 carrot f UC 33333 apple h VG
1 orange o FR 3 carrot c VG 3
when obj_type ='FR' then join on col1
When obj_type='VG' then join on col2
When obj_type='UC' then join on col2

Thanks In advance,
CB

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message David G Johnston 2014-07-30 22:45:24 Re: Reg: Sql Join
Previous Message Andreas Joseph Krogh 2014-07-29 11:31:05 Re: Update columns in the same table in a deferred constraint trigger