简体   繁体   English

用另一个字符串替换所有等于一个字符串的列值

[英]replace all column values equal to one string with another string

I have a MYSQL table called traceclasses and I have a column in this table called value with some of its cell values equal to E as shown below.我有一个名为 traceclasses 的 MYSQL 表,我在此表中有一个名为value的列,其中一些单元格值等于 E,如下所示。 I would like to replace all such values with U. Which query should I use to do this?我想用 U 替换所有这些值。我应该使用哪个查询来执行此操作?

在此处输入图像描述

You are looking for update :您正在寻找update

update t
    set value = 'U'
    where value = 'E';

暂无
暂无

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

相关问题 检查另一列 (2) 中的值是否等于“String1”和“String2”的列 (1) 的约束,将列 (1) 设置为非 null - Constraint for a column(1) that checks the values in another column(2) are equal to 'String1' and 'String2', setting column(1) to not null 如何使用另一个表中的匹配值替换/更新列中每个字符串的所有实例? - How do I replace/update all instances of every string in a column with matching values from another table? 更新将一列中的部分字符串替换为另一列中的部分字符串 - Update replace a part of the string in one column with part of a string from another column 不同值作为另一列中的字符串 - Distinct values as string in another column SQL 选择 col1 等于逗号分隔字符串中的值之一的所有行 - SQL select all rows where col1 is equal to one of the values in a comma separated string 替换MYSQL数据库列中所有出现的字符串 - Replace all occurences of string in column MYSQL database CakePHP虚拟字段:用另一个字符串替换一个字符串 - CakePHP virtual field: replace one string with another MySQL 将字符串从一个字符替换为另一个 - MySQL Replace string from one character to another 在MySQL中,您可以将一列中的值字符串转换为另一列中的对应值吗? - In MySQL, can you translate string of values from one column to corresponding values from another column? 选择一对在一行中具有相等值而在另一列中具有不同值的行 - Select a couple of rows having equal values in one column and different in another
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM