I have an JSON Array like following:-
[{
"order_no": "1",
"contract_no": "DCI-92700028",
"dc_in_date": "2017-11-06",
}, {
"order_no": "1",
"contract_no": "DCI-92700028",
"dc_in_date": "2017-11-06",
}, {
"order_no": "G1049",
"contract_no": "DCI-37500029",
"dc_in_date": "2017-11-06",
}]
I want to create Number of arrays which will consist all key-value pair of similar contract_no. For above Example, I want output Like:-
Array -I
[{
"order_no": "1",
"contract_no": "DCI-92700028",
"dc_in_date": "2017-11-06",
}, {
"order_no": "1",
"contract_no": "DCI-92700028",
"dc_in_date": "2017-11-06",
}]
and
Array- II
[ {
"order_no": "G1049",
"contract_no": "DCI-37500029",
"dc_in_date": "2017-11-06",
}]
Basic Idea is I have Mysql table which has two column. One is "contract_no" other one is "order_details". I want to update value of order_details as Array-I and Array-II where contract number match.
Is there a way to do this?