首页 新闻 会员 周边 捐助

distinct去重

0
悬赏园豆:5 [已解决问题] 解决于 2016-06-04 22:37
SELECT distinct(SDMS_OrganiseUnit.OrganiseUnitName), DisplayIndex,ParentOrganiseUnitID,SDMS_OrganiseUnit.OrganiseUnitID,ShortName ,DikeName FROM SDMS_OrganiseUnit
 
left join FMDS_Water_DikeProject on SDMS_OrganiseUnit.OrganiseUnitID=FMDS_Water_DikeProject.OrganiseUnitID
WHERE OrganiseUnitModel=1 AND OrganiseUnitType=3 AND SDMS_OrganiseUnit.IsDelete=0 ORDER BY DisplayIndex 

想根据OrganiseUnitName去重,而且还要查询跟多的

FMDS_Water_DikeProject 里的列,还要增加链接表查询,sql怎么写?
问题补充:

不想重复的列丢掉,因为要算合计

博学多思的主页 博学多思 | 初学一级 | 园豆:76
提问于:2015-10-14 17:02
< >
分享
最佳答案
0

OW_NUMBER() over(partition by ID order by ID) pid

收获园豆:5
清风君 | 菜鸟二级 |园豆:372 | 2015-11-05 14:10
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册