Table addressesemail:
id name line city state zip email
1 name1 address1 city1 state1 12345 NULL
2 name2 address2 city2 state2 12345 NULL
3 name3 address3 city3 state3 25869 email214
Table orders:
id email date status
1 email1 date1 closed
2 email2 date2 closed
3 email3 date3 open
Table orders_billing_address
order_id address_id
1 1
2 1
3 1
4 2
5 3
SELECT a.name, a.line1, a.line2, a.city, a.state, a.zip, group_concat(c.email)
FROM addressesemail a
LEFT JOIN orders_billing_address b ON b.address_id = a.id
LEFT JOIN orders c ON b.order_id = c.id
问题:
仅从addressesemail表导入第一行。
将所有电子邮件导入addressesemail表的第一行。
我尝试编码已经好几年了,我不知道自己做错了什么。 所有帮助表示赞赏。