Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a table with one column (double precision numbers). I also have made a function (with double precision numbers as input and output), and I want to send every value of my table to the function, and store the output in a second (new) column.

What is the best way to do this? Make a void function with a loop in it? Or are there better ways?

Thannks

share|improve this question

migrated from gis.stackexchange.com Mar 31 at 13:49

This question came from our site for cartographers, geographers and GIS professionals.

1 Answer 1

UPDATE mytbl
SET col2=myfn(col1)

should do the trick

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.