读书人

一条ORACLE 的SQL话语关于group by 的

发布时间: 2013-07-11 15:38:46 作者: rapoo

一条ORACLE 的SQL语句关于group by 的
select rownum, 'ckqy5' as layer, 'Default' as tag, 'POLYGON' as type, c.smid, c.name as title, c.examincode, x.roadnames as road from 交叉点 x left join ckqy5 c on x.ckqy5id = c.examincode where c.examincode like'%%' and x.roadnames like '%%,%%' and rownum <= 10 group by();想要得到的结果是如果title,examincode, road这三个字段全部相同的话只显示其中一条
[解决办法]
先根据这三个字段分组,这样就去除重复了,然后再加上固定的字段值

读书人网 >J2EE开发

热点推荐