join error?

Поиск
Список
Период
Сортировка
От Kemin Zhou
Тема join error?
Дата
Msg-id 424B2C4D.7040109@san.rr.com
обсуждение исходный текст
Ответы Re: join error?
Список pgsql-general
I just found out one strange behavior of the SQL engine.  This may be fixed.

table 1
create table table1 ( id integer, something text);

create table table2 (id integer, otherthing text);

select *
from table1 t1, table2 t2
where t1.id=table2.id;

-- here I made a mistake in the where clause I should have used
--  where t1.id=t2.id

This query produces a lot of MORE rows than it should be, and it is doing cross join.

I am not sure this is considered a normal behavior or not. Whatever, the sql programmers
should be aware such mistakes.

If you have any comments please let me know.

Thanks.

Kemin



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

Предыдущее
От: Adam Siegel
Дата:
Сообщение: Recovering real disk space
Следующее
От: "Andrus"
Дата:
Сообщение: Re: Empty date