Thread [SQL] Mehrere Tabellen in eine temporäre Tabelle zusammenfassen. (4 answers)
Opened by Kuerbis at 2012-10-12 16:46

payx
 2012-10-12 17:17
#162618 #162618
User since
2006-05-04
564 Artikel
BenutzerIn

user image
Hallo Kuerbis,

ungeprüft sinngemäß:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
create table temp_table as
select
*
from
haupttabelle as h
left outer join filialtabelle01 as f1 on
h.id = f1.h_id
left outer join filialtabelle02 as f2 on
h.id = f2.h_id
-- usw.
;


Annahme: Die foreign keys in den Filialtabellen heißen h_id.

Das Konstrukt mit create table ... as geht m.W. nicht mit jedem RDBMS.

HTH
Grüße
payx

View full thread [SQL] Mehrere Tabellen in eine temporäre Tabelle zusammenfassen.