Please check my mySQL query for phpMyAdmin -
i in need of changing multiple records in database. i'm new if @ have figured out far through research , let me know if looks correct appreciate it.
i have few thousand fields contain "0" , need remove every "0" contains nothing. ran query find them all.
select * `wp_postmeta` `meta_key` = '_regular_price' , `meta_value` = '0'
i need every record or row of "meta_value" contains "0" empty. after looking around think can run following in phpmyadmin query remove "0" every "meta_value" contains "0" , leave others alone.
does following correct?
update `wp_postmeta` set `meta_value` = '' `meta_value` =0;
thanks help.
if want remove database, want use this:
delete `wp_postmeta` `meta_value` = 0 , `meta_key` = '_regular_price'
you'll have understand difference between value containing ''
(a string 0 characters), 0
(integer), '0'
(a string containing 0) , null
value (or no value @ all).
check database if meta_value
column contains varchar
or int
(in case it's varchar suppose) , if column may contain null
value (=nullable).
Comments
Post a Comment