Watch this example on YouTube:
Here is my table
the following statement will get the biggest value for each user, weather it is Bonus, Salary or Gambling
Select CustomerName ,
(Select Max(Amount)
From (Values (Bonus), (Salary), (Gambling)) as tblAllTotals(Amount))
From Table3
Here is my output
No comments:
Post a Comment