Αρχεία ανά ημέρα: 23 Ιανουαρίου 2025

With

WITH daily_data AS ( SELECT sub_account, ref_date, TOTAL_PAYMENTS, LAG(TOTAL_PAYMENTS) OVER (PARTITION BY sub_account ORDER BY ref_date) AS prev_day_total FROM AB_MIS2.mis.LGS WHERE REF_DATE > ‘2023-12-29’ ) SELECT sub_account, ref_date, COALESCE(TOTAL_PAYMENTS – prev_day_total, TOTAL_PAYMENTS) AS daily_payments FROM daily_data WHERE COALESCE(TOTAL_PAYMENTS – prev_day_total, … Συνέχεια

Δημοσιεύθηκε στη SQL | Σχολιάστε