sql 里怎么统计字段的完善百分比
一个表里有 A B C D E F G …… 一系列字段要求统计出一行里哪些字段完善了百分之多少(也就是完善百分比)是不是得用 is not null 来进行计算具体该如何写,用什么函数,用什么方法效率最高,能列举出来更好
其他答案
我觉得用存储过程比较好,假设A为主键create proc pname @pri int --@pri这个参数是表的主键--类型与表的主键类型一致asselect * into temp from table_name where A=@prideclare @count intset @count=1select @count=@count+1 from temp where B is not 展开
2010-12-01 04:30
来自北京市
赞(0)点赞赞(0)举报
免责声明:问答内容均来源于互联网用户,房天下对其内容不负责任,如有版权或其他问题可以联系房天下进行删除。


