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.