Re: [SQL] PgSQL 6.5.1 and Group BY pb

From: "Albert REINER" <areiner(at)tph(dot)tuwien(dot)ac(dot)at>
To: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] PgSQL 6.5.1 and Group BY pb
Date: 1999-08-25 20:51:41
Message-ID: 19990825225141.B159@frithjof
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)tph(dot)tuwien(dot)ac(dot)at>
---------------------------------------------------------------------------

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Clayton Cottingham 1999-08-25 21:04:21 Re: [SQL] more info on ..out of memory error on dumping over 1, 000, 000 to file
Previous Message tjk@tksoft.com 1999-08-25 17:50:03 Re: [SQL] Dumping Oracle tables into Postgres