我使用 pgsql,现在需要更新一列,在每个单元格中添加“.jpg”。
UPDATE image SET image_tag= image_location + '.jpg'::character varying;
但它显示
ERROR: operator does not exist: character varying + character varying LINE 1: UPDATE image SET image_tag= image_location + '.jpg'::charact... ^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
错误
那么怎么解决呢。谢谢!!!
最佳答案
据我所知,PostgreSQL 使用 ||
进行连接,而不是 +
。
9.4: String Functions and Operators
UPDATE image SET image_tag = image_location || '.jpg'
关于sql使用更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11029867/