Re: Reg: Sql Join - Mailing list pgsql-sql

From Oliver d'Azevedo Christina
Subject Re: Reg: Sql Join
Date
Msg-id 1D742D88-394D-4B9D-ADF8-D0C832A5B16D@gmail.com
Whole thread Raw
In response to Reg: Sql Join  (CrashBandi <crashbandicootu@gmail.com>)
List pgsql-sql
I am not sure if I understand what you're trying to achieve. 
It would help if you could provide an output example. 

Best,
Oliver 

Sent via iPhone, apologies for any errors

Em 30/07/2014, às 11:08 PM, CrashBandi <crashbandicootu@gmail.com> escreveu:

Hi,

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

table A
namecol1col2col3col4
apple100111111APL
orange200222223ORG
carrot300333333CRT


table B
custom_namevalueobj_typeobj_id
appleaFR100
orangeoFR200
carrotcVG300
appledFR11111
orangeeVG22222
carrotfUC33333
applehVG1
orangeoFR3
carrotcVG3

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
 

pgsql-sql by date:

Previous
From: David G Johnston
Date:
Subject: Re: Reg: Sql Join
Next
From: Gavin Flower
Date:
Subject: Re: Reg: Sql Join