LoginSignup
0
0

More than 1 year has passed since last update.

【mysql】最新の日付を取得する

Posted at

最新の日付のレコードを取得する

max関数を使用する

SELECT max(日付のカラム) FROM テーブル名;
  • 結果として最新のカラムのみ取得できる。

ORDER BYを使用する

SELECT * FROM テーブル名 ORDER BY カラム名 DESC LIMIT 1;
  • 結果として最新のレコード全体が取得できる。
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