Fully Back orders Query:
-----------------------------------
SELECT *
FROM oe_order_headers_all oh
, wsh_delivery_details wd
,oe_order_lines_all ool
WHERE
oh.header_id = wd.source_header_id
AND wd.released_status = 'B'
and ool.HEADER_ID=oh.header_id
AND NOT EXISTS (
SELECT 1
FROM wsh_delivery_details wd1
WHERE wd1.released_status! = 'B'
AND wd1.source_header_id = oh.header_id
)
-----------------------------------
SELECT *
FROM oe_order_headers_all oh
, wsh_delivery_details wd
,oe_order_lines_all ool
WHERE
oh.header_id = wd.source_header_id
AND wd.released_status = 'B'
and ool.HEADER_ID=oh.header_id
AND NOT EXISTS (
SELECT 1
FROM wsh_delivery_details wd1
WHERE wd1.released_status! = 'B'
AND wd1.source_header_id = oh.header_id
)
No comments:
Post a Comment