开发者

how can i arrange the output of my data i am using group concat?

i want to arrange the output of my data in descending Here is my code:

$result3 = mysql_query("SELECT grade1.Semester, curriculum.SCode, curriculum.SDesc, curriculum.Lec, curriculum.Lab, curriculum.Units, curriculum.Prereq, GROUP_CONCAT(grade1.Grade1) as Grade1 , students.StudNo, grade1.YearLevel
FROM students 
    INNER JOIN grade1 
        ON students.StudNo = grade1.G1StudNo 
    INNER JOIN curriculum
        ON curriculum.SCod开发者_JS百科e = grade1.G1SCode
         WHERE StudNo = '$id'
GROUP BY StudNo,SCode ")

Here is the output:

how can i arrange the output of my data i am using group concat?

.

What i want to happen is 5,5,1.. how can i do that when i am using group_concat?


Check out the docs on GROUP_CONCAT:

GROUP_CONCAT(grade1.Grade1 ORDER BY grade1.Grade1 DESC)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜