Hi I have a Redshift DB and am trying to insert data from the table "scans" / column "net_rate" (data type numeric) into another table "visits_by_scan" / column "scan_cost" (data type numeric). The query I am using is the below:
insert into visits_by_scan (scan_cost)
select sum(cast(s.net_rate as decimal(30,4)))
from scans s
When I try to run this query I get the following numeric overflow error message:
How to insert the data without any errors? Any help is appreciated.

decimal(31, 4)? - Gordon Linoff