Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql Magento:查询导出不带类别的产品+;属性可见性_Sql_Magento - Fatal编程技术网

Sql Magento:查询导出不带类别的产品+;属性可见性

Sql Magento:查询导出不带类别的产品+;属性可见性,sql,magento,Sql,Magento,我有一个查询来选择所有与某个类别无关的产品。 此处查询: SELECT cpe.entity_id, cpe.sku FROM catalog_product_entity as cpe LEFT JOIN catalog_category_product as ccp on cpe.entity_id = ccp.product_id WHERE category_id IS NULL 现在我将看到属性可见性的值(目录、搜索、目录和搜索,不单独可见) 此属性值位于以下表中:catalog\u

我有一个查询来选择所有与某个类别无关的产品。 此处查询:

SELECT cpe.entity_id, cpe.sku
FROM catalog_product_entity as cpe
LEFT JOIN catalog_category_product as ccp
on cpe.entity_id = ccp.product_id
WHERE category_id IS NULL
现在我将看到属性可见性的值(目录、搜索、目录和搜索,不单独可见)

此属性值位于以下表中:catalog\u productentity\u ind,其中属性id为89

SELECT *
FROM `catalog_product_entity_int`
WHERE `attribute_id` =89
现在,我将显示category为NULL的属性值(attribute_id=89),如以下示例所示:

产品id |产品SKU |属性值(id 89)|类别(所有为空)


我该怎么做?

有效,但第一行有语法错误:在单词“可见性”之后没有逗号…than非常有效。只是修复了它。谢谢
SELECT cpe.entity_id, cpe.sku, cpe_int.value as visibility 
FROM catalog_product_entity as cpe
LEFT JOIN catalog_category_product as ccp
on cpe.entity_id = ccp.product_id
LEFT JOIN catalog_product_entity_int as cpe_int
ON cpe.entity_id = cpe_int.entity_id
AND cpe_int.attribute_id = 89
WHERE ccp.category_id IS NULL