select t1.entity_id,t5.name,t1.sku,t2.Description,t3.ShortDescription,t4.Specifications,t6.value as Weight from catalog_product_entity as t1
left join (select entity_id,value as `Description` from catalog_product_entity_text where attribute_id=72) t2
on t1.entity_id=t2.entity_id
left join (select entity_id,value as `ShortDescription` from catalog_product_entity_text where attribute_id=73) t3
on t1.entity_id=t3.entity_id
left join (select entity_id,value as `Specifications` from catalog_product_entity_text where attribute_id=136) t4
on t1.entity_id=t4.entity_id
left join (select entity_id,value as `name` from catalog_product_entity_varchar where attribute_id=71) t5
on t1.entity_id=t5.entity_id
left join catalog_product_entity_decimal as t6 on t1.entity_id=t6.entity_id
where t6.attribute_id=80
order by t1.entity_id asc limit 20
/*
attribute_id字段的值表示什么具体要你自己的表.
我这里
catalog_product_entity_decimal表attribute_id=80时value字段的值是产品的Weight属性;
catalog_product_entity_text表attribute_id=72时value字段的值是产品的Description属性,
attribute_id=73时value字段的值是产品的ShortDescription属性,
attribute_id=136时value字段的值是产品的Specifications属性,
*/
Magento返回产品name,sku,Description,ShortDescription,Specifications,Weight 的 SQL查询语句
最新推荐文章于 2022-04-21 08:56:00 发布