The order can't be influneced.
SELECT JSON_OBJECT('vehicle_rent',JSON_EXTRACT('{
"task_vehicle": [
{
"vehicle_note": "Anonymous Proof",
"vehicle_rent": "2000"
}
],
"task_material": [
{
"material_note": "Anonymous Proof",
"material_amount": 200
}
],
"task_regular_amount": {
"other": {
"other_amount": "250"
},
"labour": {
"labour_amount": "250"
}
},
"task_purchase_breakdown": [
{
"pa_amount": "200"
},
{
"pa_amount": "200"
}
],
"task_transport_breakdown": [
{
"ta_amount": "250",
"transport_type": "Bus"
}
]
}'
, '$.task_vehicle[0].vehicle_rent'),'material_amount',
JSON_EXTRACT('{
"task_vehicle": [
{
"vehicle_note": "Anonymous Proof",
"vehicle_rent": "2000"
}
],
"task_material": [
{
"material_note": "Anonymous Proof",
"material_amount": 200
}
],
"task_regular_amount": {
"other": {
"other_amount": "250"
},
"labour": {
"labour_amount": "250"
}
},
"task_purchase_breakdown": [
{
"pa_amount": "200"
},
{
"pa_amount": "200"
}
],
"task_transport_breakdown": [
{
"ta_amount": "250",
"transport_type": "Bus"
}
]
}'
, '$.task_material[0].material_amount')
,'other_amount',
JSON_EXTRACT('{
"task_vehicle": [
{
"vehicle_note": "Anonymous Proof",
"vehicle_rent": "2000"
}
],
"task_material": [
{
"material_note": "Anonymous Proof",
"material_amount": 200
}
],
"task_regular_amount": {
"other": {
"other_amount": "250"
},
"labour": {
"labour_amount": "250"
}
},
"task_purchase_breakdown": [
{
"pa_amount": "200"
},
{
"pa_amount": "200"
}
],
"task_transport_breakdown": [
{
"ta_amount": "250",
"transport_type": "Bus"
}
]
}'
, '$.task_regular_amount.other.other_amount'),'ta_amount',
JSON_EXTRACT('{
"task_vehicle": [
{
"vehicle_note": "Anonymous Proof",
"vehicle_rent": "2000"
}
],
"task_material": [
{
"material_note": "Anonymous Proof",
"material_amount": 200
}
],
"task_regular_amount": {
"other": {
"other_amount": "250"
},
"labour": {
"labour_amount": "250"
}
},
"task_purchase_breakdown": [
{
"pa_amount": "200"
},
{
"pa_amount": "200"
}
],
"task_transport_breakdown": [
{
"ta_amount": "250",
"transport_type": "Bus"
}
]
}'
, '$.task_transport_breakdown[0].ta_amount')) as result
| result |
| :------------------------------------------------------------------------------------------ |
| {"ta_amount": "250", "other_amount": "250", "vehicle_rent": "2000", "material_amount": 200} |