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

MySQL で日付の加算・減算をする関数

Posted at

データベースに投入するデータを作成する場合など。
データベース関数を利用すると良い。

例えば、期間(日付)のデータ(data.sql)を用意する必要がある場合に、関数を使っていれば修正が不要となるため。

昨日: DATE_ADD(NOW(), INTERVAL - 1 DAY)
今日: NOW()
明日: DATE_ADD(NOW(), INTERVAL 1 DAY)

色々ある。

MySQL 日付および時間関数

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?