Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
だから基本的に私は自分のウェブサイトで人気のある記事を表示する機能を作ろうとしています.
私はmysqlで1週間以内に作成された行を見つける方法をさまよっていますか? 日付フィールド データが「1283124091」のような UNIX タイムスタンプからのものである場合
where lastActivity > UNIX_TIMESTAMP(NOW() - INTERVAL 7 day)
これは 7 日分の秒であることに注意してください。
過去 7 日間のアクティビティが必要な場合
where lastActivity > UNIX_TIMESTAMP(CURDATE() - INTERVAL 7 day)