Skip to content

How to set is_anchor attribute to “no” for all categories with display_mode attribute ‘static block only’?

i have many categories with display mode “static block only”, but anchor by this categories is “yes”.

enter image description here
For example, i can change this attribute for ALL categories with query:

SELECT * FROM eav_attribute where attribute_code = 'is_anchor';
UPDATE catalog_category_entity_int set value = 0 where attribute_id = 51;

How can i change with sql query a attribute is_anchor to “no”, only if the attribute display_mode is “static block only’?