79487557

Date: 2025-03-05 20:04:16
Score: 2
Natty:
Report link

Your problem statement is not clear with regards to the dot/decimal.

Doing the following will cast (round) the double as an integer then convert to character:

con.execute("""
UPDATE my_table
SET string_column = CAST( CAST(double_column AS INTEGER) as VARCHAR)
""")

If the intention is to trim the decimal entirely (as suggested by @Barmar):

con.execute("""
UPDATE my_table
SET string_column = SPLIT_PART(CAST(double_column AS VARCHAR), '.', 1)
""")
Reasons:
  • Blacklisted phrase (1): regards
  • Has code block (-0.5):
  • User mentioned (1): @Barmar
  • Low reputation (0.5):
Posted by: mirmo