简体   繁体   English

为表格中的所有列设置数据吗?

[英]Set data for all columns in table?

I have a table called users filled with columns. 我有一个名为users的表,其中填充了列。 There's a column called daily_points that I want to change to 3 for every column in the table. 有一个名为daily_points的列,我想将表中的每一列更改为3。 How do I do this? 我该怎么做呢? Replace won't work, since it will affect data. 替换将不起作用,因为它将影响数据。

如果要将表users内的所有rows daily_points column的值设置为3 ,则可以使用以下语句。

UPDATE users SET daily_points = 3;

I think you just need an UPDATE query to set daily_points = 3 for each and every rows of your users table so 我认为您只需要一个UPDATE查询就可daily_points = 3 users表的每一行设置daily_points = 3

UPDATE `users` 
SET `daily_points` = '3';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM