如何在任何列中将属性值乘以0.20

时间:2014-05-02 16:26:37

标签: mysql

我有以下查询。我可以在下面的查询中将价格乘以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'

1 个答案:

答案 0 :(得分:1)

从您的评论I have selected price as avg margin.看起来eav.value是您想要的字段乘以0.2,您可以这样做:

SELECT e.sku, (eav.value * 0.2) AS avg_margin