#magento #sql

Magento special price SQL

Get sepcial prices using SQL: SELECT * FROM `catalog_product_entity_decimal` as `price` INNER JOIN `eav_entity_type` AS `entity` ON `price`.`entity_type_id` = `entity`.`entity_type_id` INNER JOIN `eav_attribute` AS `attribute` ON `price`.`attribute_id` = `attribute`.`attribute_id` WHERE `entity`.`entity_type_code` = 'catalog_product' AND `attribute`.`attribute_code` = 'special_price' AND `price`.`value` IS NOT NULL ORDER BY `price`.`entity_id` DESC Update special prices in magento using sql UPDATE `catalog_product_entity_decimal` AS `price` INNER JOIN `eav_entity_type` AS `entity` ON `price`.`entity_type_id` = `entity`.`entity_type_id` INNER JOIN `eav_attribute` AS `attribute` ON `price`. ...

#magento #sql

Magento change product meta data by SQL Queries

Editing contents of meta data for a big product base, can be very time consuming. But You can always use SQL… Get `atributte_id` for meta data: SELECT attribute_id,attribute_code FROM `eav_attribute` WHERE `attribute_code` LIKE '%meta%' The result should be similiar to: +--------------+------------------+--------------+| attribute_id | attribute_code | backend_type |+--------------+------------------+--------------+| 40 | meta_title | varchar || 41 | meta_keywords | text || 42 | meta_description | text || 76 | meta_title | varchar || 77 | meta_keyword | text || 78 | meta_description | varchar |+--------------+------------------+--------------+ We’ll use the attribute_id in the next query. ...