I have this query for MySql database:
SELECT
pim_pimcore_database.object_query_RGL.rulecode AS "rulecode",
pim_pimcore_database.object_query_RGL.DescrizioneRegola AS "rule_desc",
pim_pimcore_database.object_relations_RGL.position AS "id",
pim_pimcore_database.objects.o_classId,
pim_pimcore_database.objects.o_key,
pim_pimcore_database.object_collection_ruleIF_RGL.Operatore,
pim_pimcore_database.object_collection_ruleIF_RGL.Concatenatore
FROM
pim_pimcore_database.object_query_RGL
LEFT JOIN pim_pimcore_database.object_relations_RGL
ON pim_pimcore_database.object_query_RGL.oo_id =
pim_pimcore_database.object_relations_RGL.src_id
LEFT JOIN pim_pimcore_database.objects
ON pim_pimcore_database.object_relations_RGL.dest_id = pim_pimcore_database.objects.o_id
LEFT JOIN pim_pimcore_database.object_collection_ruleIF_RGL
ON pim_pimcore_database.object_relations_RGL.position =
pim_pimcore_database.object_collection_ruleIF_RGL.`index`
AND pim_pimcore_database.object_relations_RGL.src_id =
pim_pimcore_database.object_collection_ruleIF_RGL.o_id
GROUP BY
pim_pimcore_database.object_relations_RGL.position AS "ID"
WHERE
pim_pimcore_database.object_query_RGL.oo_id = 1042 AND
pim_pimcore_database.object_relations_RGL.ownername ="IfStatement"
That gives me the result:
But what I need is table like this:
How do I change the query for the desired output?