PostgreSQL-利用递归的方法获得一个数组的所有子数组

create or replace function subarrays(inarray anyarray) returns table (inarr anyarray) as $$ WITH RECURSIVE r AS ( SELECT inarray ar1 UNION ALL SELECT array_remove(ar1 ,sub) FROM ( SELECT ar1, unnest(ar1)…

Read More