SQL question

From: hamann(dot)w(at)t-online(dot)de
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: SQL question
Date: 2023-01-14 16:32:56
Message-ID: wolfgang-1230114173256.A0116016@linux-tuxedo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hi,

I have atable with a "name" column, and I order it usually
order by regexp_match(name, 'regex1'), regexp_match(name, 'regex2')
orthe equivalent
order by (regexp_match(name, 'regex1'))[1], (regexp_match(name, 'regex2'))[2]

Is there a wayto create a function so the statement could read
select ... order by myfunc(name)

Best regards
Wolfgang

Browse pgsql-general by date

  From Date Subject
Next Message Ajin Cherian 2023-01-15 04:09:25 Re: Support logical replication of DDLs
Previous Message Tom Lane 2023-01-14 16:23:07 Re: row estimate for partial index