Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
A. Bernaards wanted a temp table combining articles A to F from table 1 (A-D) and table 2 (B,D,E,F). Reinhard Habichtsberg and Paul Roberts suggested UNION (not UNION ALL) of matching selects INTO TEMP. Robert Taylor and Art S. Kagel gave a join into a temp table or INSERT...SELECT. Whether this solved it was not stated.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Robert Taylor — — source: Informix-list mailing list archive (1991-1998)
If I'm getting you right ( excuse me if I'm not )
SELECT
t1.A, t1.B, t1.C, t1.D, t2.e, t2.f
FROM
table1 t1, table2 t2
WHERE
( t1.B = t2.B and t1.D = t2.D )
INTO TEMP t_table1_table2 WITH NO LOG;
Obvioulsy use just the select part to do an unload or whatever to check it
works. Then incorporate it into an INSERT or use it to create a temporary
table etc.
HTH.
A. Bernaards — — source: Informix-list mailing list archive (1991-1998)
Hi All,
I've got table 1 with 4 articles A, B, C, D
and i've got a second table 2 with articles B, D, E, F,
and I want to create a third (temp)table 3 with the articles from table 1 &
2, from A throw F.
How do I manage that?
I've tried a lot with temp tables, joins and outer joins but i just can't
find out!
Greetings
Alex
A. Bernaards <Xpiet@bruynzeel.com> schrieb in im Newsbeitrag: 3861fbba$0$16694@news2.zeelandnet.nl...
> Hi All,
>
> I've got table 1 with 4 articles A, B, C, D
> and i've got a second table 2 with articles B, D, E, F,
> and I want to create a third (temp)table 3 with the articles from table 1 &
> 2, from A throw F.
>
> How do I manage that?
What about union:
select articles from table_1
union
select articles from table_2
into temp table_3
The selected structure of the rows in table_1 and table_2 have to be
identically. Union eliminates all double rows.
Don´t use union all in this case.
HTH
Reinhard
↪ replying to A. Bernaards
Paul Roberts — — source: Informix-list mailing list archive (1991-1998)
In article <3861fbba$0$16694@news2.zeelandnet.nl>,
A. Bernaards <Xpiet@bruynzeel.com> wrote:
>Hi All,
>
>I've got table 1 with 4 articles A, B, C, D
>and i've got a second table 2 with articles B, D, E, F,
>and I want to create a third (temp)table 3 with the articles from table 1 &
>2, from A throw F.
>
>How do I manage that?
How about select col1
from table_1
union
select col2
from table_2
into temp table_3 ?
↪ replying to Robert Taylor
Art S. Kagel — — source: Informix-list mailing list archive (1991-1998)
Robert Taylor wrote:
>
> If I'm getting you right ( excuse me if I'm not )
>
> SELECT
> t1.A, t1.B, t1.C, t1.D, t2.e, t2.f
> FROM
> table1 t1, table2 t2
> WHERE
> ( t1.B = t2.B and t1.D = t2.D )
> INTO TEMP t_table1_table2 WITH NO LOG;
>
> Obvioulsy use just the select part to do an unload or whatever to check it
> works. Then incorporate it into an INSERT or use it to create a temporary
> table etc.
Or for a permanent table, after creating the table:
INSERT INTO newtableSELECT
t1.A, t1.B, t1.C, t1.D, t2.e, t2.f
FROM
table1 t1, table2 t2
WHERE
t1.B = t2.B and t1.D = t2.D;
Art S. Kagel
Your privacy choices
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.