Watch this example on YouTube:
Here is my table
The following query will get minimum bonus, salary or gambling for each customer, whichever is the lowest:
Select CustomerName,
(Select Min(Amount)
From (Values (Bonus), (Salary), (Gambling)) as tblMinimum(Amount))
From Table3
Here is my output:
No comments:
Post a Comment