Get product sku with item_number

SELECT a.entity_id,a.value_id AS item_number,b.`sku` FROM catalog_product_entity_varchar  a  
INNER JOIN catalog_product_entity b  ON b.`entity_id`=a.`entity_id`
AND  a.attribute_id=190

entity_id ,item_number,product_name,sku
SELECT
a.entity_id
,a.value AS item_number ,b.value AS product_name ,c.sku FROM catalog_product_entity_varchar a
INNER JOIN catalog_product_entity_varchar b ON a.`entity_id`=b.`entity_id`
INNER JOIN catalog_product_entity c ON a.`entity_id`=c.`entity_id`
AND a.attribute_id=190
AND b.attribute_id=65

Update SKu

UPDATE T_ORDER_ITEM
INNER JOIN catalog_product_entity_varchar a ON T_ORDER_ITEM.tx_item_id =a.value INNER JOIN catalog_product_entity c ON a.entity_id=c.entity_id
AND a.attribute_id=190 SET T_ORDER_ITEM.tx_seller_sku=c.sku

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s