...
SQL for receiving unique JobProfile Ids where Match Profile inside this Job Profile has an association with the Modify Action Profile and this association has order = 0 and current job profile was NOT deleted:
Code Block |
---|
SELECT DISTINCT m.jsonb->>'jobProfileId' AS jobProfileId FROM {tenantId}_mod_di_converter_storage.match_to_action_profiles m JOIN {tenantId}_mod_di_converter_storage.action_profiles a ON m.jsonb->>'detailProfileId' = a.jsonb->>'id' JOIN {tenantId}_mod_di_converter_storage.job_profiles j ON m.jsonb->>'jobProfileId' = j.jsonb->>'id' WHERE a.jsonb->>'action' = 'MODIFY' AND m.jsonb->>'order' = '0' AND j.jsonb->>'deleted' = 'false'; |