33
29

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 5 years have passed since last update.

【MySQL】日時の計算(INTERVAL)

Posted at

##例

--現在時刻から60秒前以降の値のものを抽出
select * from foo where modified < now() - interval 60 second;
 
--7日後を表示
select now() + interval 7 day;

##構文

+(-) INTERVAL 数値 単位

単位として使えるもの

MICROSECOND
SECOND
MINUTE
HOUR
DAY
WEEK
MONTH

33
29
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
33
29

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?