How To Get The Original Promised Delivery Date Column In PO Line Locations Table
SELECT promised_date,
line_location_id
FROM po_line_locations_archive_all
WHERE (
revision_num, line_location_id) IN
(
SELECT Min (revision_num),
line_location_id
FROM po_line_locations_archive_all
WHERE line_location_id = <<line_location_id >> -- You need to put your line_location_id here from po-line-locations-all table.
GROUP BY line_location_id);
(OR)
SELECT po_line_id,
promised_date AS original_promised_date
FROM (
SELECT line_location_id,
po_line_id,
promised_date,
last_update_date,
revision_num,
row_number() over (PARTITION BY po_line_id ORDER BY revision_num ASC) rn
FROM apps.po_line_locations_archive_all
WHERE line_location_id = <<line_location_id >> ) orig_promis_date
WHERE rn=1;