
postgre-sql
L0911611012
这个作者很懒,什么都没留下…
展开
-
mybatis+postgresql crosstab 函数动态行转列
crosstab(text source_sql, text category_sql) source_sql 需要行转列的原始数据 category_sql 列 crosstab 函数有个问题就是列数量必须提前定义,不能动态生成,只能后台提前生成然后传给mybatis 作为参数 如下面的columns ,这样可以做到动态行转列 SELECT * FROM原创 2017-12-04 17:46:19 · 2057 阅读 · 1 评论 -
postgre 动态行转列
postgresql crosstab(text source_sql, text category_sql) api 应用建表脚本 分数表 CREATE TABLE score ( "id" int8 NOT NULL, "item_id" int8 NOT NULL, "item_size_id" int8 DEFAULT (-1) NOT NULL, "score" numeric(18,原创 2017-12-06 10:41:08 · 3461 阅读 · 0 评论