Tuesday, 17 July 2012

duplicate value report query


/* Formatted on 2012/07/16 17:42 (Formatter Plus v4.8.8) */
SELECT   'Staging', inventory_org,COUNT (item), serial_number, --to_subinventory,
         from_subinventory, transaction_quantity, transaction_type,
         transaction_date,  to_loc_segment1, to_loc_segment2,
         to_loc_segment3, to_loc_segment4, from_loc_segment1,
         from_loc_segment2, from_loc_segment3, from_loc_segment4,
         to_crew_number, from_crew_number
    FROM xxmtz_inv_scan_trans_stg
GROUP BY inventory_org,
         serial_number,
         to_subinventory,
         from_subinventory,
         transaction_quantity,
         transaction_type,
         transaction_date,
         to_loc_segment1,
         to_loc_segment2,
         to_loc_segment3,
         to_loc_segment4,
         from_loc_segment1,
         from_loc_segment2,
         from_loc_segment3,
         from_loc_segment4,
         to_crew_number,
         from_crew_number
  HAVING COUNT (item) >= 2

No comments:

Post a Comment