sql - Query for local to global mapping of data -
i need mapping local codes global codes. output should have local code, name , description mapped global code, name , description. kindly me desired output below specifications-
i have 3 tables -
mapping_versions, mapping_tables , allowed_values
mapping_versions:
submission_id (number), local_id (number), local_category (varchar), local_country_code (varchar), global_id (number), global_category (varchar), global_country_code (varchar)
mapping_tables:
submission_id (number), local_allowed_value (number), global_allowed_value (number)
allowed_values:
allowed_value (number), id (number), code (varchar), name (varchar), description (varchar)
allowed_value = local_allowed_value + global_allowed_value
[allowed_value contains both local_allowed_value & global_allowed_value]
id = local_id + global_id
[id contains both local_id & global_id]
mapping_versions
, mapping_tables
connected through submission_id
. mapping should done based on allowed_value
.
output should contain following fields:
local_category, local_country, code, name, description global_category, global_country, code, name, description
Comments
Post a Comment