sql 按照信息完整度排序

[复制链接]
查看11 | 回复2 | 2013-3-25 21:59:19 | 显示全部楼层 |阅读模式
建表后信息如下:按照字段有值个数排序,sql如下:SELECT id, column1, column2, column3, column4, column5, column6, column7, column8 ,(count1+count2+count3+count4+count5+count6+count7+count8) count_all FROM (SELECT id, column1, column2, column3, column4, column5, ...
回复

使用道具 举报

千问 | 2013-3-25 21:59:19 | 显示全部楼层
把30个属性全写到order by 后面类似:select one,two,three from tabel order by one , two ,three desc我记得有值是会排在null的前面,没装环境测不了呵呵``如果不行只能类似这样了 (不一定正确,思路是这样)select one,two,thr...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行