![]() There should be no need to repeat all those sub-queries. Queries with the same number have the same from and where but different selects. I've added comments to inditify all the individual queries contained within. WHERE rcpt_status.receipt_header_key = rh.receipt_header_keyĪND rcpt_status.new_status = '1500') -rcpt_status.new_status_date- rcpt_status.new_status_date THEN cancelled_date.status_date -cancelled_date.status_dateĮLSE (SELECT MAX (rcpt_status.new_status_date)įROM yfs_receipt_status_audit rcpt_status WHERE st.status = (SELECT MAX (status) -query 4 (SELECT 'Partially ' || st.description -query 2b (same as 2 apart from the ||) ![]() WHERE st.status = (SELECT MIN (status) -query 3 WHERE ors.order_header_key = oh.order_header_keyĪND ors.order_line_key = ol.order_line_key WHERE st.status = (SELECT MAX (status) -query 3ĪND p.process_type_key = st.process_type_keyĪND p.pipeline_key = (SELECT DISTINCT ors.pipeline_key -query 3a ![]() (SELECT SUM (sts.status_quantity) -query 1a WHERE sts.order_header_key = oh.order_header_keyĪND sts.order_line_key = ol.order_line_keyĭECODE ((SELECT SUM (ol.ordered_qty)-query 1 WHEN DECODE ((SELECT SUM (ol.ordered_qty)-query 1
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |