0

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

2
  • 3
    WTH are you using EXECUTE everywhere? There's nothing dynamic about these queries. Commented Jan 14, 2022 at 8:09
  • At my work place all the queries are Dynamic - hence I am asked to put everything in dynamic. :( Commented Jan 14, 2022 at 8:11

1 Answer 1

1
select string_agg( unnest, ' ' order by ordinality desc) 
from unnest(regexp_split_to_array('03 0F 0E AB 0B 05 0E E4', ' ')) 
WITH ORDINALITY;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.