Skip to content
Advertisement

Multiply two existing columns and add result as new column in table

I’ve created a new column ‘jahresbeitrag’ and now I’m trying to multiply two numeric columns to save the values from the query result in this column, but for some reason the query doesn’t work. PgAdmin start executing the query, but it stays at …waiting for the query to complete. Don’t know what I’m doing wrong.

Result should be:

My query

Advertisement

Answer

I think you are looking for a generated/virtual column.

In this way you don’ t need to update your table, it is automatically calculated.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement