我了解了select replace('string','to be replaced','with this')
函数,但我想知道有没有一种方法可以对整个列做些什么,比如这个
select replace(table.column1,'replace this', 'with this');
现在,命令返回Query 1 ERROR: Unknown table 'private_db' in field list
您需要一个FROM
子句。
SELECT replace(column1, 'replace this', 'with this') AS new_column1
FROM yourTable
这将返回column1
中的所有值,并进行替换。