Help Join Tables

Поиск
Список
Период
Сортировка
От BlackMage
Тема Help Join Tables
Дата
Msg-id 27507462.post@talk.nabble.com
обсуждение исходный текст
Список 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.


В списке pgsql-general по дате отправления:

Предыдущее
От: Alexei Vladishev
Дата:
Сообщение: Re: Multiple buffer cache?
Следующее
От: Keaton Adams
Дата:
Сообщение: Cache lookup failed for relation message in PG 8.3.7