我有以下查询。我可以在下面的查询中将价格乘以0.20吗?
SELECT e.sku, eav.value AS 'avg margin'
FROM catalog_product_entity e
JOIN catalog_product_entity_decimal eav
ON e.entity_id = eav.entity_id
JOIN eav_attribute ea
ON eav.attribute_id = ea.attribute_id
WHERE ea.attribute_code = 'price'
答案 0 :(得分:1)
从您的评论I have selected price as avg margin.
看起来eav.value
是您想要的字段乘以0.2
,您可以这样做:
SELECT e.sku, (eav.value * 0.2) AS avg_margin