SQL-向输出值添加10%
我有以下SQL-向输出值添加10%,sql,magento,attributes,copy,Sql,Magento,Attributes,Copy,我有以下SQL查询: INSERT INTO ry_catalog_product_entity_decimal (entity_type_id, attribute_id, store_id, entity_id, value) SELECT entity_type_id, 290, store_id, entity_id, value FROM ry_catalog_product_entity_decimal WHERE attribute_id = 65; 这是将Magento属性从一
SQL
查询:
INSERT INTO ry_catalog_product_entity_decimal
(entity_type_id, attribute_id, store_id, entity_id, value)
SELECT entity_type_id, 290, store_id, entity_id, value
FROM ry_catalog_product_entity_decimal
WHERE attribute_id = 65;
这是将Magento属性从一列复制到另一列。“290”是从“65”复制的属性。我想知道如何在“65”中增加10%的价格,并在“290”中反映出来
谢谢
INSERT INTO ry_catalog_product_entity_decimal
(entity_type_id, attribute_id, store_id, entity_id, value)
SELECT entity_type_id, 290, store_id, entity_id, ((a.value * .1) + a.value) as value
FROM ry_catalog_product_entity_decimal a
WHERE attribute_id = 65;