Reputation: 31
in psql if a value is '03 0F 0E AB 0B 05 0E E4'
And I want it to be - E4 0E 05 0B AB 0E 0F 03 order is reversed but strings haven't.
is it possible? The reverse function reverses it to ' 4E E0 50 B0 BA E0 F0 30
Upvotes: 0
Views: 492
Reputation: 31
select string_agg( unnest, ' ' order by ordinality desc)
from unnest(regexp_split_to_array('03 0F 0E AB 0B 05 0E E4', ' '))
WITH ORDINALITY;
Upvotes: 1