1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

SQL操作で改行を挿入する

Posted at

##はじめに
SQL操作する時に文言や数字を挿入することはよくあると思いますが、改行のある文章を挿入したいと困ったことはありませんか。
今回はSQL操作で改行を挿入する方法をまとめます。

##SQL操作で改行を挿入する

SQLで改行したい時 || CHR(13) ||を用いる。

例(PostgreSQL)
('改行' || CHR(13) ||  'テスト')

改行
テスト

になります。

##おわりに
ツールを使ってデータを挿入することもできますが、まとめてデータを挿入したい時はSQLを実行した方が早いのでSQLの小技を使いましょう。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?