On Wednesday, October 16, 2024, Sam Stearns <sam(dot)stearns(at)dat(dot)com> wrote:
> Tried changing to this:
> (coalesce(REGEXP_REPLACE(broker_mc::numeric, '[^0-9]+', '', 'g'), 0)),
>
Both parts of the coalesce need to be integer. Therefore:
regexp_replace(…)::integer
In short, the output of the text manipulation better be something that can
be cast to integer if you want coalesce to produce an integer.
David J.