Autor Beitrag
motion
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 295

XP, Linux
D7 Prof
BeitragVerfasst: So 13.01.08 22:15 
Sind in MySql5 SQL-Operationen über mehrere Datenbanken hinweg möglich?
Beispiel Select, Insert/updates oder auch Join über Tabellen in zwei Datenbanken.
ausblenden SQL-Anweisung
1:
2:
3:
4:
SELECT db1.products.*,db2.artikel.* 
FROM db1.products
JOIN db2.artikel
ON db1.products.products_id=db2.artikel.id_artikel

Das wird leider als syntaktisch falsch abgelehnt...
motion Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 295

XP, Linux
D7 Prof
BeitragVerfasst: Mo 14.01.08 20:04 
Habe die Antwort gefunden: Alias definieren:
ausblenden SQL-Anweisung
1:
2:
3:
SELECT * FROM db1.products t1
left JOIN db2.artikel t2
ON t1.products_id=t2.id_artikel