select distinct on (
array_to_string(
(select array_agg(xx) from (
select lower(x) from unnest(string_to_array(lower(value), ' ')) x order by x
) xx), ' ')
) value
from dup;
table:
create table dup (
value text
);
select distinct on (
array_to_string(
(select array_agg(xx) from (
select lower(x) from unnest(string_to_array(lower(value), ' ')) x order by x
) xx), ' ')
) value
from dup;
create table dup (
value text
);