7
8

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でn分前を取得するクエリ

Posted at
SELECT * FROM 'テーブル名' WHERE 'カラム名' > CURRENT_TIMESTAMP + INTERVAL - 10 MINUTE

参考元:MySQL5 - n分前、n時間前、n日後の日付を取得する | interval

MINUTEの他に下記のunitが使用できます。

unit 説明
MICROSECOND マイクロ秒
SECOND
MINUTE
HOUR
DAY
WEEK
MONTH
YEAR
7
8
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
7
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?