I have a few tables and I need to select multiple fields from each. This query works but it doesn't class rows as unique, since if multiple translationids exist, there are multiple rows with the same translationid. I need a single row for each translationid.
SELECT DISTINCT elements.translationid, translations.language, translations.translation, translationcomments.comment
FROM elements
INNER JOIN translations ON translations.translationid = elements.translationid
LEFT JOIN translationcomments ON translationcomments.translationid = translations.translationid
ORDER BY elements.id
If I add a group by clause for "translationid", for a reason I don't understand only a quarter or so of the results are returned. Is there a way I can select just the unique translationids?
SELECT DISTINCT elements.translationid, translations.language, translations.translation, translationcomments.comment
FROM elements
INNER JOIN translations ON translations.translationid = elements.translationid
LEFT JOIN translationcomments ON translationcomments.translationid = translations.translationid
ORDER BY elements.id
If I add a group by clause for "translationid", for a reason I don't understand only a quarter or so of the results are returned. Is there a way I can select just the unique translationids?