Database query

Elgg 2.3.14

I have two objects: Parent with subtype_parent and Child with subtype_child.

In Child: container_guid = Parent_guid.

Child has also two metadata 1) metadata_a and 2) metadata_b. Both are populated with integer.

I would like to get a recordset with the following columns:

Parent_guid, Parent_title, sum_of_metadata_a, sum_of_metadata_b

Order by date

I’d appreciate any help.

Thank you very much