Help Join Tables

From: BlackMage <dsd7872(at)uncw(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Help Join Tables
Date: 2010-02-08 22:35:06
Message-ID: 27507462.post@talk.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hey,

I'm having some trouble trying to join tables because I'm trying to join
data in a column to a column name. An example looks like this:

Table 1:
field_names(varchar 255) | field_title(varchar 255)
name_field | User Name
interest_field | User Interest
number_field | User Number

Table 2:
user_id | name_field | interest_field | number_field
1 | John | Baseball | 555-5555

For the beginning of a sql query I have "SELECT table2.name_field,
table2.interest_field, table2.number_field, table1.field_title JOIN table1
ON ?????????? WHERE table2.userid=1"

So basically I am trying to match up the column name with the field. Can
anyone help me with this?

Thank

--
View this message in context: http://old.nabble.com/Help-Join-Tables-tp27507462p27507462.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2010-02-08 22:44:13 Re: Re: [GENERAL] FM format modifier does not remove leading zero from year
Previous Message Michael van der Kolff 2010-02-08 21:23:49 WINDOW functions - proposed addition weight (dp) for percent_rank, cume_dist