Table column with numeric and string values

From: Firthouse banu <penguinsfairy(at)gmail(dot)com>
To: "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Table column with numeric and string values
Date: 2021-09-13 08:54:41
Message-ID: CAK_Ha4yB_gr7ugb1Xy70y_QvazXz55_fYxvRxzSaneAVSqEUOA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello everyone,

Need a urgent help.

I have a table sqlt_data with column strungvalue as character varying , in
that column we have both numbers and string.
I have function which pulls this values and do round(avg(string
value::numeric,2),0) . Am able to run the function fine with numeric values
and it is obvious but for string values getting error. How to make this
function work with string values . As far as I know avg or round cannot be
done on string values. Please advise.

Thanks
Firthouse

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message soumitra bhandary 2021-09-13 09:17:27 Re: Table column with numeric and string values
Previous Message liam saffioti 2021-09-13 05:03:58 Re: autoovacuum launcher process