PostgreSQL do block, json query, dynamic SQL, crosstab 实现动态行转列透视表 pivot table
用一个学生注册课程的实例来演示如何实现动态行列表运行环境:PostgreSQL9.6,psql客户端studentidfirstnamelastname1AnneLee2SarahChristian3JohnSmithstudentidcourse1OperationalSystem(CS501)1Compiler(CS401)1DataStructure(CS101)2OperationalSy