ISSUE: Every derived table must have its own alias
I know this is a well known issue but i even cant fix it.
SELECT imageID, sourceNode_id, targetNode_id, edge.description, edge.id
LEFT JOIN node_edge ON edge.id = node_edge.edge_id
WHERE imageID='"+partID+"' AND sourceNode_id IS NOT NULL AND targetNode_id IS NOT NULL
ORDER BY sourceNode_id
GROUP BY edge.id
I want to order before grouped so the expression with the lowest sourceNode "survives" the GROUP .