Skip to content
Advertisement

how to Update an empty table with the result of a query

i have a table name average rating. i want to update my table name final rating with the result of this query

how can i do this?

Take a look at image attached

Advertisement

Answer

Maybe something like

or if the FinalRating table contains more information you could also specify the columns

you can also add a where clause to either query if you need a subset of data.

Edit: If this is not something that is one off and has to be run repeatedly the above solution would duplicate the data

in that case I recommend you merge the tables

Notice that I gave the AVG(avgRat) an alias so that I can reference it later

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