New Line character \n in SQLite concatenate

前端 未结 2 1828
你的背包
你的背包 2020-12-15 19:12

I know that, in some Programming language, if you do something like:

\'This is on first line \\n This is on second line\'

Then it will disp

相关标签:
2条回答
  • 2020-12-15 19:48

    Try char(13) (if you want to see it in Windows notepad).

    select col || char(13) from mytable
    
    0 讨论(0)
  • 2020-12-15 20:00

    SQL has no backslash escapes.

    You can generate a newline in a string by writing it directly in the query:

    SELECT [Field1] || '
    ' || [Field2] FROM MyTable
    

    or use a blob literal:

    SELECT [Field1] || x'0a' || [Field2] FROM MyTable
    

    or use the char function:

    SELECT [Field1] || char(10) || [Field2] FROM MyTable
    
    0 讨论(0)
提交回复
热议问题