Sort a text aggregate created with array_agg in postgresql

前端 未结 6 2087
傲寒
傲寒 2021-02-05 04:42

I have a table in postgresql. The following table \"animals\" will do to explain my problem:

name
------
tiger
cat
dog

Now I am using the follo

6条回答
  •  伪装坚强ぢ
    2021-02-05 05:17

    Have you tried to use generate_series() on the array, and then do a SELECT...ORDER BY on that result (or just nest it inside of the SELECT) before you convert it to a string?

提交回复
热议问题