I have a question about my sql query that seems to be playing.
I am completely ready to admit any mistake in the code that I use, but I canβt mind that my life works on what happens.
The table below is:
id groupingid groupid timeadded ------------------------------------------ 1 1 4 1318200332 2 2 2 1318200346 3 3 1 1318200362 4 4 3 1318200388 5 5 6 1318217398 6 7 7 1318217402 7 8 8 1318217408 8 6 5 1318217413 9 9 9 1318217417 10 5 7 1319007223 65 14 14 1319068963 64 11 15 1319068950 62 10 15 1319068921 63 13 14 1319068950 61 12 14 1319068887 60 11 14 1319068850 59 10 14 1319068847 70 12 15 1319069000
All I want to do is return any row with "groupid" of 15, and then isolate the row with the highest "groupingid"
so i use the following sql_query
SELECT * FROM `mdl_groupings_groups` WHERE groupid = 15 ORDER BY MAX('groupingid')
He keeps coming back:
id groupingid groupid timeadded ------------------------------------------ 64 11 15 1319068950
whereas it should return a string with identifier 70
Please tell me that it is a TOTALLY USUAL thing that I am missing because I am in tight deadline and do not know what is wrong here.
We apologize if this is incorrectly formatted and flame if necessary ..
thanks
source share