Kevin Chou
Kevin Chou

Reputation: 3

Updating a table with a function in SQL

Say I want to take average of a set of numbers I have in a table and want to put that average in another column in the same table. How would I do that?

Help is much appreciated

Upvotes: 0

Views: 63

Answers (2)

alybaba726
alybaba726

Reputation: 400

UPDATE [tblname]
SET [columnname] = ([h]-[hr])/([ab]-[k]-[hr])

Upvotes: 0

jradich1234
jradich1234

Reputation: 1425

Try....

UPDATE hitters SET ColumnName = (((h-hr)/(ab-k-hr))

Upvotes: 2

Related Questions