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




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



posted @ 2018-08-27 19:42  闭眼的鱼  阅读(1675)  评论(0编辑  收藏  举报