转载自http://database.51cto.com/art/201011/234851.htm

MYSQL表字段最大值是我们经常需要取得的值,下面就为您介绍查询MYSQL表字段最大值的方法,希望可以让您对MYSQL表字段最大值有更多的了解。

查询MYSQL表字段最大值的方法

如图、 假如想要取得最大ID的name值(这里只是借ID为例 不用ordery by)

解决办法:select max(id) from db_name                                                      x

将导致

查询MYSQL表字段最大值的方法 

正确解法:select * from dbname where id=(select max(id) from dbname)   

查询MYSQL表字段最大值的方法

相关文章:

  • 2022-01-24
  • 2022-12-23
  • 2022-01-12
  • 2022-01-26
  • 2022-01-20
  • 2021-10-23
  • 2021-11-19
  • 2022-12-23
猜你喜欢
  • 2022-02-16
  • 2021-09-20
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案