我在为公司开发系统时遇到了两难境地,而项目管理不是!
SELECT clients_owner.Name, clients_owner.`number`, clients_shops.Shopname, clients_shops.PostCode, clients_shops.Location
FROM clients_shops inner join clients_owner ON
clients_owner.ShopID = clients_shops.ShopID
UNION
SELECT clients_fans.Fan
FROM clients_shops inner join clients_fans ON
clients_shops.ShopID = clients_fans.ShopID
以下查询返回以下错误:
1222 - 使用的 SELECT 语句有不同的列数
但是以此为例:Mysql JOIN (multiple) tables被标记为答案,所以查询显然是有效的。我哪里出错了?
而以下连接合并两个表:
SELECT
clients_owner.Name, clients_owner.Number, clients_shops.Shopname, clients_shops.PostCode,
clients_shops.Location FROM clients_shops INNER JOIN clients_owner on
clients_owner.ShopID = clients_shops.ShopID
工作顺利