DB lookup block
This commit is contained in:
parent
9addd59605
commit
e19f1562af
7
main.sql
7
main.sql
@ -1,6 +1,5 @@
|
||||
WITH abc AS (
|
||||
SELECT
|
||||
DISTINCT
|
||||
SELECT DISTINCT ON (app.application_key)
|
||||
app.application_key,
|
||||
CAST(app.application_timestamp AS TIMESTAMP) AS application_timestamp,
|
||||
LOWER(app.application_email_address) AS application_email_address,
|
||||
@ -14,7 +13,9 @@ WITH abc AS (
|
||||
ON app.application_key = master.application_key
|
||||
LEFT JOIN public.originated_loan AS loans
|
||||
ON master.originated_loan_key = loans.originated_loan_key
|
||||
-- WHERE app.application_customer_type = 'Direct New'
|
||||
WHERE app.application_key = $application_key
|
||||
OR app.application_key = ANY(ARRAY$connected_application_keys::text[])
|
||||
ORDER BY app.application_key, app.application_timestamp DESC
|
||||
),
|
||||
|
||||
current_app AS (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user