multi order mapped to 1 del

Published February 22, 2026 By Sai Sree Ram Gundepudi
SELECT DISTINCT
            wnd.NAME
          , COUNT (DISTINCT (wdd.source_header_number))
   FROM
            apps.wsh_new_deliveries       wnd
          , apps.wsh_delivery_assignments wda
          , apps.wsh_delivery_details     wdd
   WHERE
            wnd.delivery_id            = wda.delivery_id
            AND wda.delivery_detail_id = wdd.delivery_detail_id
            AND wdd.org_id             = 204
            -- AND wnd.confirm_date       > SYSDATE - 2
            AND wnd.status_code       != 'CL'
   GROUP BY
            wnd.NAME
   HAVING
            COUNT (DISTINCT (wdd.source_header_number)) > 1
   ORDER BY
            wnd.NAME

Was this solution helpful?

Your feedback helps improve our technical knowledge repository.

Share this article