Hi
i far as i know mysql GROUP BY grouping to the last find record.
Is there any solution to GROUP BY the first record
I have setup the ORDER in SQL command and i need GROUP BY return the first record and not the last
EDIT
Here is the Query
SELECT
DISTINCT(master.masterID),
langData.*,
master.*
FROM master_table as master
INNER JOIN lang_table as langData ON
langData.masterID=master.masterID
GROUP BY master.masterID
ORDER BY
CASE
WHEN langData.lang='currentLang' THEN 1 ELSE 999 END ,
master.name desc LIMIT 0,10
The query above select the masterID for multi language table and suppose to return FIRST the records in currentLang and order them by name AND THEN all other languages
DONT ask me with i dont set the language in JOIN.This is the way to be done.
SO everything works Fine so far expect the scenario that i have a record with languages en and fr.If currentLang is en then based on langData.lang='currentLang' THEN 1 ELSE 999 END the en order is 1 and fr order is 999 and instead of getting the value of en i get the value of fr.
Thats why i want group to the first row.