标签:pre weight ber location eid bubuko font back code
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‘)
ROW_NUMBER() OVER(PARTITION BY ORDER BY )RN 只选一行
标签:pre weight ber location eid bubuko font back code
原文地址:https://www.cnblogs.com/Snowfun/p/9162880.html