Skip to content

Commit

Permalink
prevent duplicate locations
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew D.Gramigna committed Nov 15, 2023
1 parent 93d432d commit 18e1e08
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs_outline as (
),

all_secondary_locations as (
select opening_id, string_agg(secondary_location_name, ', ') as secondary_locations from job_locations
group by 1
select opening_id, run_hash, string_agg(secondary_location_name, ', ') as secondary_locations from job_locations
group by 1,2
)

select
Expand All @@ -20,4 +20,5 @@ select
else concat(jobs_outline.location_name, ', ', all_secondary_locations.secondary_locations)
end as location
from jobs_outline
left join all_secondary_locations on jobs_outline.opening_id = all_secondary_locations.opening_id
left join all_secondary_locations on jobs_outline.opening_id = all_secondary_locations.opening_id
and jobs_outline.run_hash = all_secondary_locations.run_hash

0 comments on commit 18e1e08

Please sign in to comment.