SQL查询某字段最小值:(使用min() max())
SELECT *
FROM stutable
WHERE (age IN
(SELECT MIN(age)
FROM stutable));
SQL查询某字段最小值:(不使用min() max())
sql server 数据库下的:
select top 1 工资 from table1 order by 工资 desc;
或者:select top(1) * from table1 order by 工资 desc;
其他的类似
select top 1 with ties id,工资 from table1 order by 工资 asc
最少
MySql数据库下使用:
select * from stutable order by age asc limit 0,1
本文介绍了如何在SQLServer和MySql数据库中使用不同的方法查询字段的最大值和最小值,包括使用min()和max()函数以及不使用这些函数的方法。
3543

被折叠的 条评论
为什么被折叠?



