apend table 2 to table 1 in 1 row. - Mailing list pgsql-general

From Ben-Nes Michael
Subject apend table 2 to table 1 in 1 row.
Date
Msg-id 005601c17b30$e3b633a0$aa0f5ac2@canaan.co.il
Whole thread Raw
List pgsql-general
Hi All

im trying to do a select that will return me the JOIN result appended in one
row per user_id and not in multi columns.

Is it possible ?

user_id | username | pet_type | pet_name | pet_type | pet_name |
1          |   BH        | dog        | Garfield    | cat          |
Garfield   |


CREATE TABLE users (
user_id SERIAL PRIMARY KEY,
username VARCHAR(10)
)

CREATE TABLE users_prop (
user_id INT4 REFERENCES users ON UPDATE CASCADE ON DELETE CASCADE,
pet_type VARCHAR(10),
pet_name VARCHAR(10)
)



--------------------------
Canaan Surfing Ltd.
Internet Service Providers
Ben-Nes Michael - Manager
Tel: 972-4-6991122
http://sites.canaan.co.il
--------------------------



pgsql-general by date:

Previous
From: "Serguei Mokhov"
Date:
Subject: Re: Could be a FAQ: prepare/execute in PHP?
Next
From: mordicus
Date:
Subject: INSERT INTO BUG