Marvin3 Marvin3 - 4 years ago 133
SQL Question

Change visibility of all simple products

I'm trying to change visibility of all SIMPLE-only products via SQL.

Here is how I select all values of visibility attribute:

SELECT * FROM `catalog_product_entity_int` WHERE attribute_id = 102

table has
column which is product entity ID, and
that should be changed to
for all simple products.

Here is how I select all simple products:

SELECT * FROM `catalog_product_entity` WHERE `type_id`= 'simple'

What I can't do, is write query that would update
column of
for all simple products.

Answer Source

as i got ur question, this simple code will be work for u.

i assume that relationship between these two tables are -entity_id

update catalog_product_entity_int set value =1 
where attribute_id = 102 and  entity_id=
(select entity_id from `catalog_product_entity` where `type_id`= 'simple')
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download