擅长:python、mysql、java
<p>您需要进入原始sql的世界,但并非所有数据库都支持它。对于postgresql,您需要查看<a href="http://www.postgresql.org/docs/9.4/static/functions-aggregate.html" rel="nofollow">array_agg</a>,而在mysql和sqlite中,要使用的函数是<a href="https://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html" rel="nofollow">group_concat</a></p>