How can I add text to SQL Column

前端 未结 5 1092
盖世英雄少女心
盖世英雄少女心 2021-02-14 17:15

I want to update 1 column in SQL Table. Example: Current value in column is like this

2013/09/pizzalover.jpg 
2013/10/pasta.jpg       

Now i wa

5条回答
  •  旧巷少年郎
    2021-02-14 17:29

    If you are using MYSql, you can use the concat() as :

    update tableName set columnName= CONCAT('www.mypizza.com/', columnName);
    

    SQLFiddle

    If you are using oracle you can use the concatenation operator '||' as :

    update tableName set "columnName"='www.mypizza.com/'||"columnName";
    

    SQLFiddle

    In SQL Server you can use + for string concatenation as:

    update tableName set name='www.mypizza.com/'+columnName;
    

    SQLFiddle

提交回复
热议问题