How can I update Mysql to an entire column if another one is doing it?

Asked

Viewed 38 times

0

Somebody smart can help me with this?

I have a table in Mysql named "Sellers" and I wanted all the rows in a "seller_image_s3" column to receive an update of "1" if the "seller_image" column is filled in. But if this column "seller_image" is empty, the column "seller_image_s3" will receive a value "0".

Could someone create a query so I can run it? I’d be very grateful.

  • 1

    have q test if the syntax is correct for mysql...update sellers set seller_image_s3 = (case when seller_image is null then 0 else 1 end);

  • Could you show me how the query would look? I want to make the right change by php myadmin

  • if you want to change is update, and is the command I wrote above...

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.