0
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 1 year has passed since last update.

NULLと「""」と「" "」の違い

0
Last updated at Posted at 2024-02-28

初めに

DBテーブルの特定のカラムに値が入っているかどうかを確認しようとした際に、
これらの違いについて気になったので今回まとめてみようと思いました。

結論

・「""」は が値として入っている状態
・「" "」は 空白文字 が入っている状態
・NULLはそもそも値が入っていない状態

まとめ

NULLは「中身が存在しない」場合に使われる用語で、「中身が存在しない」と「空である」ことはプログラムの世界では同じではないようです。
「""」であるということは空が値として入っている状態であり、 NULLはそもそも値が入っていない状態を指すようです。

[参考サイト]
https://note.com/shift_tech/n/ne2b5bc6af1c3
https://wa3.i-3-i.info/diff290moji.html

0
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
0
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?