join error? - Mailing list pgsql-general

From Kemin Zhou
Subject join error?
Date
Msg-id 424B2C4D.7040109@san.rr.com
Whole thread Raw
Responses Re: join error?
List 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 by date:

Previous
From: Adam Siegel
Date:
Subject: Recovering real disk space
Next
From: "Andrus"
Date:
Subject: Re: Empty date