-3

我有以下查询可以正常返回,但是id我可以让它显示而不是显示default_ps_products_manufacturers.name

SELECT  `manufacturer_id` 
FROM  `default_ps_products` 
INNER JOIN  `default_ps_products_manufacturers` ON default_ps_products.manufacturer_id = default_ps_products_manufacturers.id
4

2 回答 2

2

所以只需像这样添加您要选择的列

SELECT  default_ps_products_manufacturers.name  
FROM  default_ps_products 
INNER JOIN  default_ps_products_manufacturers 
ON default_ps_products.manufacturer_id = default_ps_products_manufacturers.id
于 2013-04-08T19:27:10.837 回答
2

您是否尝试在 ? 中包含该列SELECT

SELECT m.name
FROM  `default_ps_products` p
INNER JOIN  `default_ps_products_manufacturers` m
    ON p.manufacturer_id = m.id
于 2013-04-08T19:27:32.413 回答