0
这里的其他行是我的代码选择一列是一个重复的,也选择不重复
select i.RefNo,i.Premium,i.Description from (select d.Description,c.IsActiveRecord,c.RefNo,c.MovementID, c.Premium,ROW_NUMBER()
over(partition by c.premium order by c.refno) n from lif_mgm_t_contract c
inner join SDT_LJG_T_MovementDescription d with (nolock) on c.MovementID = d.MovementID) i
where i.n = 1 and i.MovementID <> 0
所以例如
表
a
a
b
我想查询返回
a
b and not just a hope this makes sense --only a beginner
您的代码无关,与你的样本数据。 –
最初我有重复,所以我写了代码,现在它只返回一个1 – Percy
你会怎么做? @GordonLinoff – Percy