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>
---------------------------------------------------------------------------