3条回答 默认 最新
- edouardzyc 2015-06-10 01:12关注
danielinbiti 思路是可以的,但是结果不对把
既然人家内联可以出所有结果, 表icstockbill和SEOrder都会有重复的内码啊,稍微改下select t2.出库单,
case when t2.RN = 1 then t1.内码 else '' end as 内码,
case when t2.RN = 1 then t1.编号 else '' end as 编号,
case when t2.RN = 1 then t1.客户 else '' end as 客户,
case when t2.RN = 1 then t1.日期 else '' end as 日期
from
(select 出库单, 内码, ROW_NUMBER()OVER(PARTITION BY 内码 ORDER BY 内码) AS RN FROM icstockbill) t2
join
(select 内码,编号,客户,日期 FROM SEOrder) t1
on t2.FInterID=t1.FInterID本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报