[newbie] Relations...

From: "John Moo" <projects(at)bitnet-nospam(dot)pl>
To: pgsql-general(at)postgresql(dot)org
Subject: [newbie] Relations...
Date: 2001-06-05 18:11:04
Message-ID: 9fj785$81j$1@news.tpi.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a real stupid (propably) problem :)
I have two tables, one holding accounts:

CREATE TABLE accounts (
login varchar(32) primary key,
password varchar(32),
name varchar(128),
email varchar(64));

and one holding posts (to news system):

CREATE TABLE news (
author varchar(32) references accounts(login),
title varchar(32),
body text,
date timestamp default now(),
id serial);

...and I want using _one_ SQL SELECT get all news rows but with
accounts.name relation.
"SELECT name,title,body,date FROM accounts,news" doesn't work fine,
because it gets all rows from accounts table.

Thanks for help
John Moo

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Randall Perry 2001-06-05 18:13:40 Re: Text data type doesn't accept newlines?
Previous Message Len Morgan 2001-06-05 17:37:47 Re: Calling external programs