Check out example codes for "t-sql select min from two values". It will help you in understanding the concepts better.

Code Example 1

SELECT
PaidForPast=(SELECT MIN(x) FROM (VALUES (PaidThisMonth),(OwedPast)) AS value(x))

Learn ReactJs, React Native from akashmittal.com