如题:查询一个最小值且不为0:
条件:tab1(id,pric)求最小值且不为0(id主键自增,pric价格字段decimal类型)
菜鸟在线等大神
select min(<查询列>) from <表名> where <查询列> <>0
select min(pric) from tab1 where pric <>0
select top 1 * from tab1 where pric<>0 order by pric
select top 1 * from tab1 where pric<>0 order by pric desc