I have a script that pulls back charges for services. Sometimes a service is charged, then cancelled as shown in screenshot below. I was wondering if there is a function that I could use in my “Select” or “Where” that would keep those rows that cancel each other out from pulling into the extract?:
Code:
SELECT
c.service_dt_tm "Service Date",
c.item_price,
c.charge_type_cd
FROM
charge c,
customer e
WHERE
c.bill_item_id = 363803 AND
c.charge_description = 'Oil Change' AND
c.customer_id = e.customer_id AND
e.active_ind = 1 AND
e.customer_type_cd IN (9489, 9480, 9488) AND
e.garage_loc_cd = 8473
Things I have tried but have not had any luck:
“Case” in the “Where” clause
“Match_Recognize”
Any and all help, directions, suggestions, guidance, references greatly appreciated.
Thanks, Roland