求个SQL语句,如图中meta_value数值大于70的,自动让他减去70
如:
56,那么不变 78,那么78-70,让他变成8
补充:谢谢,加个判断条件,meta_key中必须是"views"才用上面的减法呢
UPDATE tblname SET field=field-70 WHERE field>70
UPDATE wp_postmeta SET meta_value=meta_value-70 WHERE meta_value>70 and meta_key="views";
UPDATE wp_postmeta SET meta_value=meta_value-70 WHERE meta_value>70 and meta_key="views";