How to sort on a postgres regex?
I'm trying to extract a number from a text field using regex and sort on it.
Perhaps using calculations:
I can't figure out the syntax.
Thank you!
Perhaps using calculations:
I can't figure out the syntax.
Thank you!
require Ash.Query
def sort_on_regex(q) do
q
|> Ash.Query.sort([asc: expr(fragment( ... ))])
end
error: undefined function expr/1
error: undefined function fragment/1calculate :serial_no_int, :integer, expr( ... )