Snowfun

导航

 

 

select  PEGGED_SO_ID,PEGGED_SO_LINE_ID  ,ITEM_ID  ,QUANTITY ,LOCATION ,SITEID from IN_SEMI_ONHAND_LOCKED 
where item_id in ('000000101011003137','000000102011000038') ;

SELECT DISTINCT PEGGED_SO_ID,PEGGED_SO_LINE_ID  ,ITEM_ID  ,QUANTITY ,LOCATION ,SITEID
        ,ROW_NUMBER() OVER(PARTITION BY ITEM_ID,LOCATION ORDER BY NULL)RN
 FROM IN_SEMI_ONHAND_LOCKED
  where item_id   in  ('000000101011003137','000000102011000038') ;

     SELECT * FROM (SELECT DISTINCT PEGGED_SO_ID,PEGGED_SO_LINE_ID  ,ITEM_ID  ,QUANTITY ,LOCATION ,SITEID
                     ,ROW_NUMBER()
                     OVER(PARTITION BY ITEM_ID,LOCATION ORDER BY NULL)RN
      FROM IN_SEMI_ONHAND_LOCKED)
      where rn=1 and item_id   in  ('000000101011003137','000000102011000038') 

 

posted on 2018-06-10 12:08  Snowfun  阅读(961)  评论(0编辑  收藏  举报