I have create custom attribute
in product upc
I want custom query
(sql) to get SKUs
and UPCs
Can anyone tell me the related tables
from where I can get data, or if anyone can share query that would be great.
attributesdatabasemagento2querysql
I have create custom attribute
in product upc
I want custom query
(sql) to get SKUs
and UPCs
Can anyone tell me the related tables
from where I can get data, or if anyone can share query that would be great.
Best Answer
Magento uses the Eav structure to save the product attribute value.
First, you have to find out your attribute type of
upc
.So, you have to open eav_attribute and run the below for gettingbackend_type
]Suppose, this attribute backend_type is varchar then magento is save the value for products of this attribute at
catalog_product_entity_varchar
Magento is saved product lie entity wise like
So, you have to find the appropriate table of this attribute then run below Query like:
Here I have done for the name attribute. For your case, you have to change
catalog_product_entity_varchar
with respect to your backend type of attribute.If select specific attributes and their values below query helpful