0
Ich habe 4 Tabelle, dieVerbinden Sie mehrere Tabelle mit mehreren Gruppen concate Mysql
trxn_tbl ist:
works_id works_date 1 3/17/2017 2 3/19/2017 3 3/18/2017
apps_txn_tbl:
id works_id apps_name 1 1 JoinBDApps 2 1 PMS 3 1 CADET COLLEGE 4 2 JoinBDApps 5 2 PMS 6 2 CADET COLLEGE 7 3 JoinBDApps 8 3 PMS 9 3 CMH
work_loc_trxn_tbl:
id works_id loc 1 1 DC 2 2 AITSO 3 3 DR
works_type_txn_tbl:
id works_id works_type 1 1 Trobleshooting 2 1 Software Upgrade 3 2 Trobleshooting 4 2 License Key Update 5 3 Trobleshooting 6 3 License Key Update
Wenn ich Abfrage Mysql Said laufen: MySQL sagte: Dokumentation
1055 - Expression # 3 von SELECT-Liste ist nicht in GROUP BY-Klausel und enthält nicht aggregierten Spalte 'dcapp_db.work_loc_txn_tbl.loc', das ist funktional nicht abhängig von Spalten in der GROUP BY-Klausel; dies ist unvereinbar mit sql_mode = only_full_group_by
Aber ich will diese Art:
works_id Works_date work_type appsname loc 1 3/17/2017 Trobleshooting, software upgrade JoinBDapps, PMS, CADET COLLEGE DR 2 3/19/2017 Trobleshooting, License Key Update JoinBDapps, PMS, CADET COLLEGE AITSO 3 3/18/2017 Trobleshooting, License Key Update JoinBDApps, PMS, CMH DRWo Problem ist und ich brauche das Tischsystem zu ändern oder abfragen Bitten helfen Sie mir .... Meine Frage ist: "Meine Abfrage ist :
SELECT trxn_tbl.works_id, trxn_tbl.works_date,work_loc_txn_tbl.loc,GROUP_CONCAT(works_type_txn_tbl.works_type SEPARATOR ',')as worktype,GROUP_CONCAT(apps_txn_tbl.apps_name SEPARATOR ',')as appname FROM trxn_tbl JOIN works_type_txn_tbl on works_type_txn_tbl.works_id=trxn_tbl.works_id JOIN apps_txn_tbl on apps_txn_tbl.works_id=trxn_tbl.works_id JOIN work_loc_txn_tbl on work_loc_txn_tbl.works_id=trxn_tbl.works_id GROUP BY trxn_tbl.works_id;"
Dank Es funktioniert ...... –
Ihr Vorschlag ist mir so hilfreich –
Ist es möglich, mehrere Gruppen Concat in meiner Anfrage hinzufügen? Ich brauche 6 oder 6 Gruppen in einer Abfrage ... Ist das möglich? –