From: Albert REINER <areiner@tph.tuwien.ac.at>
To: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] PgSQL 6.5.1 and Group BY pb
Date: Wed, 25 Aug 1999 22:51:41 +0200
Message-ID: <19990825225141.B159@frithjof> (raw)
In-Reply-To: <l03130304b3e996ea9e0d@[147.233.159.109]>
References: <37C3CEB9.AB63E3DE@popso.it>
<l03130304b3e996ea9e0d@[147.233.159.109]>
On Wed, Aug 25, 1999 at 03:58:29PM +0300, Herouth Maoz wrote:
> At 14:08 +0300 on 25/08/1999, Giampiero Raschetti wrote:
...
> In fact, the above seems to indicate that you are not well aware of what
> joins are, or at least you don't know that you have to restrict them to
> make sense of your data. You really have to add WHERE g.id = u.id.
Of course this is not at the core of Giampiero's problem, but there
are instances where you don't use a restriction, i.e. exactly when you
want to get the Cartesian product of the tables. Suppose, e.g., that
you want to generate a list of all the fields on a chess board. You
can do this by
create table rows (l char);
create table cols (n int2);
insert into rows ('a');
... (all the way to 'h')
insert into cols (1);
... (all the way to 8);
select l, n from rows, cols;
Albert.
--
---------------------------------------------------------------------------
Post an / Mail to / Skribu al: Albert Reiner <areiner@tph.tuwien.ac.at>
---------------------------------------------------------------------------
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: areiner@tph.tuwien.ac.at
Subject: Re: [SQL] PgSQL 6.5.1 and Group BY pb
In-Reply-To: <19990825225141.B159@frithjof>
References: <37C3CEB9.AB63E3DE@popso.it> <l03130304b3e996ea9e0d@[147.233.159.109]> <19990825225141.B159@frithjof>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox