-3
我想查询一个magento数据库来显示Sku,产品名称,ProductDetails,价格,WholesalePrice和Storedunits。 我有这个疑问Magento sql查询产品详细信息
SELECT
`e`.`sku`,"
IF(at_name.value_id > 0, at_name.value, at_name_default.value) AS `name`, "
IF(at_description.value_id > 0, at_name.value, at_description_default.value) AS `description` "
FROM "
`catalog_product_entity` AS `e` "
INNER Join "
`catalog_product_entity_varchar` AS `at_name_default` "
ON (`at_name_default`.`entity_id` = `e`.`entity_id`) AND "
(`at_name_default`.`attribute_id` = (SELECT attribute_id FROM `eav_attribute` ea LEFT JOIN `eav_entity_type` et ON ea.entity_type_id = et.entity_type_id WHERE `ea`.`attribute_code` = 'name' AND et.entity_type_code = 'catalog_product')) AND "
`at_name_default`.`store_id` = 0 "
Left Join "
`catalog_product_entity_varchar` AS `at_name` "
ON (`at_name`.`entity_id` = `e`.`entity_id`) AND "
(`at_name`.`attribute_id` = (SELECT attribute_id FROM `eav_attribute` ea LEFT JOIN `eav_entity_type` et ON ea.entity_type_id = et.entity_type_id WHERE `ea`.`attribute_code` = 'name' AND et.entity_type_code = 'catalog_product')) AND "
(`at_name`.`store_id` = 1) "
INNER Join "
`catalog_product_entity_text` AS `at_description_default` "
ON (`at_description_default`.`entity_id` = `e`.`entity_id`) AND "
(`at_description_default`.`attribute_id` = (SELECT attribute_id FROM `eav_attribute` ea LEFT JOIN `eav_entity_type` et ON ea.entity_type_id = et.entity_type_id WHERE `ea`.`attribute_code` = 'description' AND et.entity_type_code = 'catalog_product')) AND "
`at_description_default`.`store_id` = 0 "
Left Join "
`catalog_product_entity_text` AS `at_description` "
ON (`at_description`.`entity_id` = `e`.`entity_id`) AND "
(`at_description`.`attribute_id` = (SELECT attribute_id FROM `eav_attribute` ea LEFT JOIN `eav_entity_type` et ON ea.entity_type_id = et.entity_type_id WHERE `ea`.`attribute_code` = 'description' AND et.entity_type_code = 'catalog_product')) AND "
(`at_description`.`store_id` = 1)
返回SKU,产品名称和产品详细,但我找不到领域
“找不到剩余的字段”是什么意思?请显示示例输入,输出,所需输出。 – philipxy
以上查询返回sku,productname,productdetails。我想要返回价格,WholesalePrice和Storedunits字段,但我不知道如何搜索它们 –
谢谢,但这只是重复您之前所说的内容。什么是“搜索他们”的意思?请用更多的单词。你想知道他们在哪个表吗? – philipxy