I get a resources exceeded error when I run the following query , how can I rewrite this query to avoid that error ?
SELECT
XXX_lnaourj_ID,
XXX_DR_Tma_LC,
XXX_CR_Tma_LC,
XXX_Amount_LC,
XXX_TLAffect_LC,
XXX_Entry_Desc,
XXX_DocType,
XXX_TCode,
XXX_Company,
XXX_Posted_By,
XXX_Parked_By,
XXX_Accounting_Date,
XXX_Creation_Date
FROM
[acl_data.XXX_JE_All_Formatted]
WHERE
XXX_lnaourj_ID IN (
SELECT
XXX_lnaourj_ID
FROM
[acl_data.XXX_JE_All_Formatted]
WHERE
XXX_Creation_Date - XXX_Accounting_Date > 30 )
ORDER BY
XXX_lnaourj_ID ASC;