关于mysql函数GROUP_CONCATGROUP_CONCAT()是MySQL数据库提供的一个函数,通常跟GROUP BY一起用,具体可参考MySQL官方文档:http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat 。GROUP_CONCAT( [ DISTINCT ] expr [ ,expr ... ] [ ORDER BY { unsigned_integer | col_name | expr} [ ASC | DESC ] [ ,col_name ...] ] [ SEPARATOR str_val] )SELECT student_id, GROUP_CONCAT( courses_id) AS courses FROM student_courses WHERE student_id=2 GROUP BY student_id;"SELECT student_id, GROUP_CONCAT(courses_id) AS courses FROM student_courses WHERE student_id=2 GROUP BY student_id"SELECT student_id, GROUP_CONCAT( courses_id SEPARATOR "|||" ) AS courses FROM student_courses WHERE student_id=2 GROUP BY student_id;SELECT student_id, GROUP_CONCAT( courses_id ORDER BY courses_id DESC) AS courses FROM student_courses WHERE student_id=2 GROUP BY student_id;MySQL错误:Can"t connect to MySQL server (10060)Oracle中的AS和IS的不同及使用相关资讯 MySQL函数
- MySQL 字符串截取相关函数 (03月03日)
- MySQL函数:group_concat()函数 (07/20/2015 21:20:13)
- MySQL中count函数使用方法详解 (05/18/2015 08:54:48)
| - MySQL group_concat_max_len (10/13/2015 19:08:27)
- MySQL DATE_FORMAT() 函数 (05/21/2015 20:12:43)
- MySQL中的WITH ROLLUP (05/18/2015 08:53:18)
|
本文评论 查看全部评论 (0)