Heim  >  Fragen und Antworten  >  Hauptteil

MySQL – Datenbank-Mehrtabellen-Gemeinschaftsabfrage zum Einfügen in andere Bibliotheken

Die Tabelle ist fast die gleiche wie unten
Bibliothek A
Inhalt von Tabelle 1

id catid  areaid   title     content   linkman
12  32     4      标题一      内容一     张三

Bereich Tabelle 2

areaid  areaname 
4       中国

Tabelle 3 Kategorie

catid     catname
 32       分类项一

Bibliothek B
Tabelle Z-Liste
ID, Benutzername für Inhalt des Catg-Titels hinzufügen

Z-Tabelle und 1-Tabelle entsprechen eins zu eins
Wie können wir die Tabelle in Bibliothek b verbessern?

为情所困为情所困2706 Tage vor779

Antworte allen(1)Ich werde antworten

  • 仅有的幸福

    仅有的幸福2017-05-24 11:36:39

    insert into B.list (id, areaname, catname, title, content, linkman) select content.id, area.areaname, category.catname, content.title, content.content, content.linkman from A.content content join A.area area on content.areaid = area.areaid join A.category category on category.catid = content.catid

    Antwort
    0
  • StornierenAntwort