Skip to content
Advertisement

Join two tables, run a calculation based on their columns, and set a column based on the results

Why does my query break after this? I’m essentially running calculations based off the columns of both tables and then setting their PVPLevel when rn is a certain value between 1 and 5000.

SET PVPRanking.PVPLevel = CASE

Advertisement

Answer

It appears that you only need to include PVPLevel in the select list of the CTE:

Then, continue with your current update query as is. Note that the update itself could be simplified a bit, resting on that the range checks are always increasing from top to bottom:

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