我想从三个 3 表中的 mysql 获取数据。我正在使用LEFT OUTER JOIN
. 这是我的查询:
SELECT cms_addresses.address1 as add1,
cms_addresses.email as ademail,
cms_addresses.city as adcity,
cms_addresses.clientid
cms_addresses.country as adcountry,
cms_addresses.province as adprovince,
cms_addresses.postal as adprovince,
cms_delivery_info.d_address1,
cms_delivery_info.d_city,
cms_delivery_info.d_country,
cms_delivery_info.d_province,
cms_delivery_info.d_postal,
cms_orders.id,
cms_orders.cdate,
cms_orders.message
FROM cms_addresses
LEFT OUTER JOIN cms_delivery_info
ON cms_addresses.clientid = cms_delivery_info.d_clientid
LEFT OUTER JOIN cms_orders = cms_addresses.clientid = cms_orders.clientid
WHERE cms_orders.id = 10
and cms_addresses.addresstypeid = 1
问题是这个查询没有运行并且给了我那个错误。
不是唯一的表/别名:'cms_addresses'
请帮我解决这个问题。谢谢