Merging two arrays based on conditions
Use the UNION ALL keyword with conditions to merge two arrays
into one and iterate on its contents.
About this task
{
"customers": {
"Platinum": [
{
"region": "West Midlands",
"cid": 12,
"name": "E. W. Gilbert"
},
{
"region": "Greater Manchester",
"cid": 75,
"name": "John Doe"
}
],
"Gold": [
{
"region": "West Midlands",
"cid": 13,
"name": "G. K. Peatling"
},
{
"region": "Greater Manchester",
"cid": 76,
"name": "Tom Cruise"
}
]
}
}
Procedure
Results
[
{
"customers": [
{
"region": "West Midlands",
"cid": 12,
"name": "E. W. Gilbert",
"ranking": "Platinum"
},
{
"region": "Greater Manchester",
"cid": 75,
"name": "John Doe",
"ranking": "Platinum"
},
{
"region": "West Midlands",
"cid": 13,
"name": "G. K. Peatling",
"ranking": "Gold"
},
{
"region": "Greater Manchester",
"cid": 76,
"name": "Tom Cruise",
"ranking": "Gold"
}
]
}
]