Received: from frithjof.reiner (qmailr@a20.dialin.tuwien.ac.at [192.35.240.30]) by hub.org (8.9.3/8.9.3) with SMTP id JAA83302 for ; Thu, 26 Aug 1999 09:55:35 -0400 (EDT) (envelope-from areiner@tph.tuwien.ac.at) Received: (qmail 185 invoked by uid 500); 25 Aug 1999 20:51:41 -0000 From: "Albert REINER" Date: Wed, 25 Aug 1999 22:51:41 +0200 To: pgsql-sql@postgreSQL.org Subject: Re: [SQL] PgSQL 6.5.1 and Group BY pb Message-ID: <19990825225141.B159@frithjof> Mail-Followup-To: pgsql-sql@postgreSQL.org References: <37C3CEB9.AB63E3DE@popso.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.6i In-Reply-To: ; from Herouth Maoz on Wed, Aug 25, 1999 at 03:58:29PM +0300 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 ---------------------------------------------------------------------------