I was wondering if it was possible to multiply two columns and if so how would this take place
Suppose I have a table
a b
1 4
2 5
3 6
Could I do something like
SELECT a *b from table
Would this multiply the contents row by row then store it in a new column
Are these result right
4
10
18
That query would multiply the values, but it wouldn’t “store it in a new column” To store it you would have to issue an update statement.
Assuming you add a new column (“c”) to your table you could do:
If all you need is the new column in a result set, without modifying the underlying table you could: