sql语句-----选取最大值(有null则都不选)




select top 1 元素 from 表名 where 主键='值' AND 主键 not in (select 主键 from 表名  where 主键='值' and (元素 is NULL OR 元素 ='')) order by 元素 desc;



猜你喜欢

转载自www.cnblogs.com/hmpcly/p/9544315.html