How to get products name and sku and url key using sql query in magento 2?

Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
1
down vote
favorite
How to get products name and sku and url key using sql query in magento 2 ?
magento2 database sql programmatically
add a comment |Â
up vote
1
down vote
favorite
How to get products name and sku and url key using sql query in magento 2 ?
magento2 database sql programmatically
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
How to get products name and sku and url key using sql query in magento 2 ?
magento2 database sql programmatically
How to get products name and sku and url key using sql query in magento 2 ?
magento2 database sql programmatically
magento2 database sql programmatically
edited 1 hour ago
asked 1 hour ago
hitesh balpande
1508
1508
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
SQL QUERY:
SELECT nametable.value,
nametable.store_id,
catalog_product_entity.sku
FROM `catalog_product_entity_varchar` AS nametable
LEFT JOIN catalog_product_entity
ON nametable.entity_id = catalog_product_entity.entity_id
WHERE nametable.attribute_id = (SELECT attribute_id
FROM `eav_attribute`
WHERE `entity_type_id` = 4
AND `attribute_code` LIKE 'name')
As mentioned like Shashank Kumrawat, Sku value is store at catalog_product_entity and name field value store at catalog_product_entity_varchar
As Magento support multi-store data, So for single SKU, multiple row
can be exits.catalog_product_entity_varchar have store id field.If you >> want specific store name then just nametable.store_id = StoreId
add a comment |Â
up vote
1
down vote
You can use directly sql queries in magento2 as shown on this link -
using object manager (not recommended)
https://webkul.com/blog/magento2-write-custom-mysql-query/
Without object manager (recommended)
How to call Direct SQL Queries and join to collection In Magento2
To get SKU, you need to use table catalog_product_entity
and to get product name, need to use table catalog_product_entity_varchar
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
SQL QUERY:
SELECT nametable.value,
nametable.store_id,
catalog_product_entity.sku
FROM `catalog_product_entity_varchar` AS nametable
LEFT JOIN catalog_product_entity
ON nametable.entity_id = catalog_product_entity.entity_id
WHERE nametable.attribute_id = (SELECT attribute_id
FROM `eav_attribute`
WHERE `entity_type_id` = 4
AND `attribute_code` LIKE 'name')
As mentioned like Shashank Kumrawat, Sku value is store at catalog_product_entity and name field value store at catalog_product_entity_varchar
As Magento support multi-store data, So for single SKU, multiple row
can be exits.catalog_product_entity_varchar have store id field.If you >> want specific store name then just nametable.store_id = StoreId
add a comment |Â
up vote
2
down vote
accepted
SQL QUERY:
SELECT nametable.value,
nametable.store_id,
catalog_product_entity.sku
FROM `catalog_product_entity_varchar` AS nametable
LEFT JOIN catalog_product_entity
ON nametable.entity_id = catalog_product_entity.entity_id
WHERE nametable.attribute_id = (SELECT attribute_id
FROM `eav_attribute`
WHERE `entity_type_id` = 4
AND `attribute_code` LIKE 'name')
As mentioned like Shashank Kumrawat, Sku value is store at catalog_product_entity and name field value store at catalog_product_entity_varchar
As Magento support multi-store data, So for single SKU, multiple row
can be exits.catalog_product_entity_varchar have store id field.If you >> want specific store name then just nametable.store_id = StoreId
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
SQL QUERY:
SELECT nametable.value,
nametable.store_id,
catalog_product_entity.sku
FROM `catalog_product_entity_varchar` AS nametable
LEFT JOIN catalog_product_entity
ON nametable.entity_id = catalog_product_entity.entity_id
WHERE nametable.attribute_id = (SELECT attribute_id
FROM `eav_attribute`
WHERE `entity_type_id` = 4
AND `attribute_code` LIKE 'name')
As mentioned like Shashank Kumrawat, Sku value is store at catalog_product_entity and name field value store at catalog_product_entity_varchar
As Magento support multi-store data, So for single SKU, multiple row
can be exits.catalog_product_entity_varchar have store id field.If you >> want specific store name then just nametable.store_id = StoreId
SQL QUERY:
SELECT nametable.value,
nametable.store_id,
catalog_product_entity.sku
FROM `catalog_product_entity_varchar` AS nametable
LEFT JOIN catalog_product_entity
ON nametable.entity_id = catalog_product_entity.entity_id
WHERE nametable.attribute_id = (SELECT attribute_id
FROM `eav_attribute`
WHERE `entity_type_id` = 4
AND `attribute_code` LIKE 'name')
As mentioned like Shashank Kumrawat, Sku value is store at catalog_product_entity and name field value store at catalog_product_entity_varchar
As Magento support multi-store data, So for single SKU, multiple row
can be exits.catalog_product_entity_varchar have store id field.If you >> want specific store name then just nametable.store_id = StoreId
edited 49 mins ago
answered 55 mins ago
Amit Beraâ¦
55.3k1368162
55.3k1368162
add a comment |Â
add a comment |Â
up vote
1
down vote
You can use directly sql queries in magento2 as shown on this link -
using object manager (not recommended)
https://webkul.com/blog/magento2-write-custom-mysql-query/
Without object manager (recommended)
How to call Direct SQL Queries and join to collection In Magento2
To get SKU, you need to use table catalog_product_entity
and to get product name, need to use table catalog_product_entity_varchar
add a comment |Â
up vote
1
down vote
You can use directly sql queries in magento2 as shown on this link -
using object manager (not recommended)
https://webkul.com/blog/magento2-write-custom-mysql-query/
Without object manager (recommended)
How to call Direct SQL Queries and join to collection In Magento2
To get SKU, you need to use table catalog_product_entity
and to get product name, need to use table catalog_product_entity_varchar
add a comment |Â
up vote
1
down vote
up vote
1
down vote
You can use directly sql queries in magento2 as shown on this link -
using object manager (not recommended)
https://webkul.com/blog/magento2-write-custom-mysql-query/
Without object manager (recommended)
How to call Direct SQL Queries and join to collection In Magento2
To get SKU, you need to use table catalog_product_entity
and to get product name, need to use table catalog_product_entity_varchar
You can use directly sql queries in magento2 as shown on this link -
using object manager (not recommended)
https://webkul.com/blog/magento2-write-custom-mysql-query/
Without object manager (recommended)
How to call Direct SQL Queries and join to collection In Magento2
To get SKU, you need to use table catalog_product_entity
and to get product name, need to use table catalog_product_entity_varchar
answered 1 hour ago
Shashank Kumrawat
1,1441238
1,1441238
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f248007%2fhow-to-get-products-name-and-sku-and-url-key-using-sql-query-in-magento-2%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
