From: | "Mikhail V(dot) Majorov" <mik(at)ttn(dot)ru> |
---|---|
To: | Holger Klawitter <holger(at)klawitter(dot)de> |
Cc: | "pgsql-general(at)postgreSQL(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Re: very simple: How can I multiply tables? |
Date: | 2001-02-14 16:22:09 |
Message-ID: | 3A8AB0B1.8BDD77CC@ttn.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Holger Klawitter wrote:
>
> Yes, very simple!
>
> > How can I multiply tables using SELECT?
>
> select * from tbl1, tbl2;
I think so. But in real I have some problem with empty table.
Please, look at my example.
ttn=# create table t3 (id int4, surname text);
CREATE
ttn=# create table t2 (dt int4);
CREATE
ttn=# insert into t2 values ('4');
INSERT 34461 1
ttn=# insert into t2 values ('56');
INSERT 34462 1
ttn=# select * from t2,t3;
dt | id | surname
----+----+---------
(0 rows)
ttn=#
As I know theory I must see this:
dt | id | surname
----+----+---------
4 null null
56 null null
Result is change when I insert data in t3.
ttn=# insert into t3 values ('100', 'test');
INSERT 34463 1
ttn=# insert into t3 values ('101', 'test2');
INSERT 34464 1
ttn=# select * from t2,t3;
dt | id | surname
----+-----+---------
4 | 100 | test
56 | 100 | test
4 | 101 | test2
56 | 101 | test2
(4 rows)
ttn=#
Is it bug or normal?
Best regards,
Mik.
From | Date | Subject | |
---|---|---|---|
Next Message | Mikhail V. Majorov | 2001-02-14 16:27:13 | Re: very simple: How can I multiply tables? |
Previous Message | mike | 2001-02-14 16:01:54 | Re: Bad book review |