求一个Sql语句,有点烦
表结果为:
id smallclassid smallclassname thumbgallery isindex hit
1 343 测试 xxx 1 100
2 343 测试 xxx 0 200
3 200 test xxx 1 300
4 200 test xxx 0 300
要求计算出hit总和排在前6位的分类值(也就是必须按照smallclassid分),并按照hit总和的降序排列且isidnex的值为1,页面中需要用到smallclasid,smallclassname,isindex,thumbgallery这四个字段
id smallclassid smallclassname thumbgallery isindex hit
1 343 测试 xxx 1 100
2 343 测试 xxx 0 200
3 200 test xxx 1 300
4 200 test xxx 0 300
要求计算出hit总和排在前6位的分类值(也就是必须按照smallclassid分),并按照hit总和的降序排列且isidnex的值为1,页面中需要用到smallclasid,smallclassname,isindex,thumbgallery这四个字段
...全文


