{"id":68825,"date":"2021-08-06T22:51:13","date_gmt":"2021-08-07T02:51:13","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/magento2-update-product-attributes-using-sql\/"},"modified":"2021-08-06T22:53:21","modified_gmt":"2021-08-07T02:53:21","slug":"magento2-update-product-attributes-using-sql","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=68825","title":{"rendered":"Magento2: update product attributes using sql"},"content":{"rendered":"<p>cat update_product_attributes_using_sql.sql<br \/>\nupdate catalog_product_entity_int &#8212; select * from catalog_product_entity_int<br \/>\nset catalog_product_entity_int.value = 1<br \/>\nwhere (catalog_product_entity_int.attribute_id = 97) and catalog_product_entity_int.entity_id = (<br \/>\nselect entity_id from (<br \/>\nSELECT product.entity_id as entity_id FROM bitnami_magento.catalog_product_entity product<br \/>\ninner join catalog_product_entity_decimal price on price.entity_id = product.entity_id and (price.attribute_id in (78))<br \/>\ninner join catalog_product_entity_int status_t on (status_t.entity_id = product.entity_id) and (status_t.attribute_id=97)<br \/>\nwhere (price.value &gt;= 20 and price.value &lt;= 21)<br \/>\nand (status_t.value = 1)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>cat update_product_attributes_using_sql.sql update catalog_product_entity_int &#8212; select * from catalog_product_entity_int set catalog_product_entity_int.value = 1 where (catalog_product_entity_int.attribute_id = 97) and catalog_product_entity_int.entity_id = ( select entity_id from ( SELECT product.entity_id as entity_id FROM bitnami_magento.catalog_product_entity product inner join catalog_product_entity_decimal price on price.entity_id = product.entity_id and (price.attribute_id in (78)) inner join catalog_product_entity_int status_t on (status_t.entity_id = product.entity_id) and (status_t.attribute_id=97) where &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=68825\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1942,182],"tags":[],"class_list":["post-68825","post","type-post","status-publish","format-standard","hentry","category-magento-2-operations-using-sql","category---blog","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":27105,"url":"http:\/\/bangla.sitestree.com\/?p=27105","url_meta":{"origin":68825,"position":0},"title":"Magento 2, Update a Product Attribute with SQL","author":"Sayed","date":"May 11, 2021","format":false,"excerpt":"update catalog_product_entity_int set catalog_product_entity_int.value = 1 where (catalog_product_entity_int.attribute_id = 97) and catalog_product_entity_int.entity_id = ( select entity_id from ( SELECT product.entity_id as entity_id FROM bitnami_magento.catalog_product_entity product inner join catalog_product_entity_decimal price on price.entity_id = product.entity_id and (price.attribute_id in (78)) inner join catalog_product_entity_int status_t on (status_t.entity_id = product.entity_id) and (status_t.attribute_id=97) where (price.value >\u2026","rel":"","context":"In &quot;\u09ac\u09cd\u09b2\u0997 \u0964 Blog&quot;","block_context":{"text":"\u09ac\u09cd\u09b2\u0997 \u0964 Blog","link":"http:\/\/bangla.sitestree.com\/?cat=182"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":68814,"url":"http:\/\/bangla.sitestree.com\/?p=68814","url_meta":{"origin":68825,"position":1},"title":"Magento 2: Deactivate Products without images","author":"Sayed","date":"August 6, 2021","format":false,"excerpt":"update catalog_product_entity_int -- select * from catalog_product_entity_int set catalog_product_entity_int.value = 2 where (catalog_product_entity_int.attribute_id = 97) and catalog_product_entity_int.entity_id in ( select entity_id from ( Select distinct(product.entity_id) FROM bitnami_magento.catalog_product_entity product left join catalog_product_entity_media_gallery_value_to_entity valentity on valentity.entity_id = product.entity_id left join catalog_product_entity_media_gallery image on image.value_id = valentity.value_id and (image.attribute_id in (90)) inner join\u2026","rel":"","context":"In &quot;Magento 2 : Operations using SQL&quot;","block_context":{"text":"Magento 2 : Operations using SQL","link":"http:\/\/bangla.sitestree.com\/?cat=1942"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":68823,"url":"http:\/\/bangla.sitestree.com\/?p=68823","url_meta":{"origin":68825,"position":2},"title":"Magento 2: Update data for a custom product attribute","author":"Sayed","date":"August 6, 2021","format":false,"excerpt":"use bitnami_magento; SELECT * FROM bitnami_magento.catalog_product_entity_varcharwhere ( attribute_id = 73 ) -- and (value = '')limit 10 replace into bitnami_magento.catalog_product_entity_varchar (attribute_id, store_id, entity_id, value )SELECT 181, 0, product.entity_id, left(concat(\"https:\/\/www.amazon.com\/s?k=\", product.value),255)FROM bitnami_magento.catalog_product_entity_varchar productinner join catalog_product_entity_int status_t on ( status_t.entity_id = product.entity_id ) and ( status_t.attribute_id = 97 and status_t.value = 1\u2026","rel":"","context":"In &quot;Magento 2 : Operations using SQL&quot;","block_context":{"text":"Magento 2 : Operations using SQL","link":"http:\/\/bangla.sitestree.com\/?cat=1942"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":68822,"url":"http:\/\/bangla.sitestree.com\/?p=68822","url_meta":{"origin":68825,"position":3},"title":"Magento 2: Misc. Image related SQLs","author":"Sayed","date":"August 6, 2021","format":false,"excerpt":"select * from bitnami_magento.catalog_product_entity_media_gallery_value_to_entity where value_id in (232574, 242521) -- 232574, 242521 select * from bitnami_magento.catalog_product_entity_media_gallery_value_to_entity where value_id in (232574, 242521) -- where value like '%ud6vtf2a_5ezdxueqvnr%' --select * from bitnami_magento.catalog_product_entity_media_gallery_value_to_entity select * from bitnami_magento.catalog_product_entity_media_gallery -- where value_id in (237733, 237734) where value like '%ud6vtf2a_5ezdxueqvnr%' update bitnami_magento.catalog_product_entity_media_gallery set value = '\/u\/d\/ud6vtf2a_5ezdxueqvnr1dyny_1.jpeg'\u2026","rel":"","context":"In &quot;Magento 2 : Operations using SQL&quot;","block_context":{"text":"Magento 2 : Operations using SQL","link":"http:\/\/bangla.sitestree.com\/?cat=1942"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":16439,"url":"http:\/\/bangla.sitestree.com\/?p=16439","url_meta":{"origin":68825,"position":4},"title":"Mysql error after upgrading magento 2.3.2 to 2.3.3","author":"Sayed","date":"November 30, 2019","format":false,"excerpt":"Solution to: SQLSTATE[HY000]: General error: 1419 You do not have the SUPER privilege and binary logging is enabled (you might want to use the less safe log_bin_trust_function_creators variable), query was: CREATE TRIGGER trg_catalog_product_entity_after_insert AFTER INSERT ON catalog_product_entity FOR EACH ROW BEGIN INSERT IGNORE INTO `scconnector_google_feed_cl` (`entity_id`) VALUES (NEW.`entity_id`); END Sol:\u2026","rel":"","context":"In &quot;AI ML DS RL DL NN NLP Data Mining Optimization&quot;","block_context":{"text":"AI ML DS RL DL NN NLP Data Mining Optimization","link":"http:\/\/bangla.sitestree.com\/?cat=1910"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":69256,"url":"http:\/\/bangla.sitestree.com\/?p=69256","url_meta":{"origin":68825,"position":5},"title":"SQL Server Hints #38","author":"Author-Check- Article-or-Video","date":"August 16, 2021","format":false,"excerpt":"SQL Server Hints ---------------- What are hints? Simply to influence query execution plans to retrieve data faster. syscacheobjects ---------------- SQL server after compiling a query creates the execution plan and keeps it on syscacheobjects object. You can query the object to see the existing query plans as follows: select *\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/68825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=68825"}],"version-history":[{"count":1,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/68825\/revisions"}],"predecessor-version":[{"id":68826,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/68825\/revisions\/68826"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=68825"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=68825"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=68825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}