SELECT col,
MIN(value) KEEP(DENSE_RANK FIRST ORDER BY col) OVER(PARTITION BY col),
MAX(value) KEEP(DENSE_RANK LAST ORDER BY col) OVER(PARTITION BY col)
FROM tmp1
ORDER BY col;
...全文
2383打赏收藏
postgreSQL有keep的使用吗
postgreSQL有想Oracle中keep的使用吗? Oracle: SELECT col, MIN(value) KEEP(DENSE_RANK FIRST ORDER BY col) OVER(PARTITION BY col), MAX(value) KEEP(DENSE_RANK LAST ORDER BY col) OVER(PARTITION BY col) FROM tmp1 ORDER BY col;