Trouble with JOINS

From: Uros Gruber <uros(at)sir-mag(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Trouble with JOINS
Date: 2001-04-05 14:52:23
Message-ID: 90181935758.20010405165223@sir-mag.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi!

I have some stupid problem wich is driving me nuts.

This is my 2 tables.

CREATE TABLE one ( one_id varchar(23)
day varchar(10),
view int4,
two_id varchar(32),
PRIMARY KEY (one_id)
);

CREATE TABLE two ( tow_id varchar(32),
user varchar(12) NOT NULL,
PRIMARY KEY (client_id)
);

table one is tracking views of some user, and table two is actual data
of that user.

What i want to get from SQL is something like this

user view
u1 34
u2 14
u3 8

The data in tabel are like this
two_id day view one_id
aaa 1 15 1
bbb 1 7 2
ccc 2 2 3
bbb 2 7 4
aaa 3 19 5
ccc 3 6 6

two_id user
aaa u1
bbb u2
ccc u3

I hope you'll understand what i want to do. If not tell me.

--
Thanks,
Uros

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-04-05 15:06:24 Re: Data transfer format between UNIX server and Windows client?
Previous Message Tony Grant 2001-04-05 14:46:22 Up to my neck in it