Created
March 10, 2021 16:40
-
-
Save padak/81278e9e493b5988779804d4c3541852 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE VIEW EFEKTIVITA_TRASOVANI AS | |
SELECT | |
RECORD_CREATED::DATE AS CREATED, | |
replace(split_part(QUEUE_NAME,']',1),'[','') AS KHS, | |
RECORD_ID AS POZITIVNI, | |
KONTAKT AS KONTAKT | |
FROM "CAMPAIGN_RECORDS_PII" | |
LEFT JOIN ( | |
SELECT | |
REPLACE(REPLACE(FK_RECORD_ID,'["',''),'"]','') AS "POZITIVNI", | |
RECORD_ID "KONTAKT" | |
FROM "CAMPAIGN_RECORDS_PII" | |
WHERE "QUEUE_NAME" LIKE '%3. hovor%' | |
AND LENGTH("POZITIVNI") > 5 | |
) ON RECORD_ID = POZITIVNI | |
WHERE "QUEUE_NAME" LIKE '%1. hovor%' | |
ORDER BY CREATED DESC, KHS, POZITIVNI | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment