Re: [SQL] PgSQL 6.5.1 and Group BY pb

Поиск
Список
Период
Сортировка
От Albert REINER
Тема Re: [SQL] PgSQL 6.5.1 and Group BY pb
Дата
Msg-id 19990825225141.B159@frithjof
обсуждение исходный текст
Ответ на Re: [SQL] PgSQL 6.5.1 and Group BY pb  (Herouth Maoz <herouth@oumail.openu.ac.il>)
Список 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@tph.tuwien.ac.at>
 
---------------------------------------------------------------------------


В списке pgsql-sql по дате отправления:

Предыдущее
От: Paulo Roberto Kappke
Дата:
Сообщение: Doubts in timespan
Следующее
От: Greg Youngblood
Дата:
Сообщение: RE: [SQL] 2 million+ entries