首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

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

2013-07-11 
一条ORACLE 的SQL语句关于group by 的selectrownum, ckqy5 as layer, Default as tag, POLYGON as t

一条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这三个字段全部相同的话只显示其中一条
[解决办法]
先根据这三个字段分组,这样就去除重复了,然后再加上固定的字段值

热点排行