diff --git a/src/main/resources/sql/challenge-feeder/detail/get_registrants.sql b/src/main/resources/sql/challenge-feeder/detail/get_registrants.sql index 678e30c..57f4c77 100644 --- a/src/main/resources/sql/challenge-feeder/detail/get_registrants.sql +++ b/src/main/resources/sql/challenge-feeder/detail/get_registrants.sql @@ -10,19 +10,17 @@ select ELSE decode(ri4.value, 'N/A', '0', ri4.value)::int END AS rating, ri5.value::int AS reliability, - c.iso_alpha3_code AS countryCode, + ct.iso_alpha3_code AS countryCode, p.project_id AS challengeId from resource rur , resource_info ri1 , project p , user u - , common_oltp\:user_address_xref uax - , common_oltp\:address a - , common_oltp\:country c , project_category_lu pcl , outer resource_info ri4 , outer resource_info ri5 , outer informixoltp\:algo_rating ar + , outer(common_oltp\:user_address_xref uax, common_oltp\:address adr, common_oltp\:country ct) where p.project_id = rur.project_id and rur.resource_id = ri1.resource_id @@ -37,6 +35,6 @@ select and ar.coder_id = u.user_id and ar.algo_rating_type_id=3 and uax.user_id = u.user_id - and a.address_id = uax.address_id - and a.country_code = c.country_code + and uax.address_id = adr.address_id + and adr.country_code = ct.country_code and {filter}