JPro
JPro

Reputation: 6556

update all the fields in table which have empty values (MYSQL)

Is there any way to update all the records in a table if there is atleast one filed which has empty value?

Thanks.

Upvotes: 2

Views: 9638

Answers (1)

soulmerge
soulmerge

Reputation: 75784

Not without using all the fields in the query. If this is your table:

col0: TEXT NULL,
col1: TEXT NULL,
col2: INT NULL

you can issue:

UPDATE YourTable SET col0='yourValue' WHERE col1 IS NULL or col2 IS NULL

Upvotes: 3

Related Questions