Insert text with single quotes in PostgreSQL

后端 未结 7 2141
北海茫月
北海茫月 2020-11-21 11:28

I have a table test(id,name).

I need to insert values like: user\'s log, \'my user\', customer\'s.



        
7条回答
  •  我在风中等你
    2020-11-21 12:02

    you can use the postrgesql chr(int) function:

    insert into test values (2,'|| chr(39)||'my users'||chr(39)||');
    

提交回复
热议问题