![](/img/trans.png)
[英]Replace a string value in a column by values from same column in another table
[英]How to replace all string values from a column to another value?
我想替换列中的所有值,例如,将lane
列中的所有值替换为“所有车道”值。 我尝试使用 REPLACE function: REPLACE(lane, '%', 'All lanes')
但它不起作用。 有什么想法吗? 提前致谢!
车道 |
---|
WA-OR |
德克萨斯-纽约 |
马-新泽西 |
预期 output:
车道 |
---|
所有车道 |
所有车道 |
所有车道 |
只需使用update
:
update t
set lane = 'All lanes';
请注意,这会永久影响所有行。 如果您只想查询结果:
select 'All lanes' as lane
from t;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.