SQL查询某字段最小值
SQL查询某字段最小值:(使用min() max())SELECT *
FROM stutable
WHERE (age IN
(SELECT MIN(age)
FROM stutable));
SQL查询某字段最小值:(不使用min() max())
例如数据表中有一列为工资,查询工资最高的,可以这么写语句: sql server 数据库下的:
selecttop1工资fromtable1orderby工资desc;
或者:selecttop(1)* fromtable1orderby工资desc;
其他的类似
selecttop1withtiesid,工资fromtable1orderby工资asc
最少
MySql数据库下使用:
select * from stutable order by age asc limit 0,1
页:
[1]