Skip to content

Commit

Permalink
Combined View - Compare Award References by Value, Not String (#4454)
Browse files Browse the repository at this point in the history
* MV - Match FA&F award references on four rightmost chars

* MV - Compare award references on split string as ints
  • Loading branch information
jperson1 authored Nov 13, 2024
1 parent 7ddde86 commit 0c79ba8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend/dissemination/sql/create_materialized_views.sql
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ CREATE MATERIALIZED VIEW IF NOT EXISTS
LEFT JOIN dissemination_general dg
ON dfa.report_id = dg.report_id
LEFT JOIN dissemination_finding df
ON dfa.report_id = df.report_id
AND dfa.award_reference = df.award_reference
ON dfa.report_id = df.report_id
AND (dfa.award_reference = df.award_reference
OR
SPLIT_PART(dfa.award_reference, '-', 2)::INTEGER = SPLIT_PART(df.award_reference, '-', 2)::INTEGER)
LEFT JOIN dissemination_passthrough dp
ON dfa.report_id = dp.report_id
AND dfa.award_reference = dp.award_reference
Expand Down

0 comments on commit 0c79ba8

Please sign in to comment.