............................................... .................................................. .................................................. ..................
如何找到低ID和最大ID(我的sql)使用php?
............................................... .................................................. .................................................. ..................
______________________
| ID | XXXXXXXX |
|_____|________________|
| 2 | |
| 3 | |
| 4 | |
| 6 | |
| 8 | |
| 9 | |
| 11 | |
| 15 | |
| 20 | |
|__21_|________________|
答案 0 :(得分:3)
在发布之前在网上搜索一下也不错......
您正在寻找列上的min
和max
值。
SELECT MaxValue = MAX(ID) , MinValue = MIN(ID) FROM YourTable