@@ -4,7 +4,7 @@ description: "The LEAST logical function returns the minimum value from a list o
44author : WilliamDAssafMSFT
55ms.author : wiassaf
66ms.reviewer : randolphwest
7- ms.date : 03/06/2023
7+ ms.date : 04/04/2024
88ms.service : sql
99ms.subservice : t-sql
1010ms.topic : reference
@@ -15,7 +15,7 @@ helpviewer_keywords:
1515 - " LEAST function"
1616dev_langs :
1717 - " TSQL"
18- monikerRange : " >=sql-server-ver16 || >=sql-server-linux-ver16 || = azuresqldb-current || = azuresqldb-mi-current || = azure-sqldw-latest||=fabric"
18+ monikerRange : " >=sql-server-ver16|| >=sql-server-linux-ver16||= azuresqldb-current||= azuresqldb-mi-current||= azure-sqldw-latest||=fabric"
1919---
2020# Logical functions - LEAST (Transact-SQL)
2121
@@ -71,7 +71,7 @@ For example, **varchar(max)** can support up to 8,000 characters if using a sing
7171
7272## Examples
7373
74- ### A. Return maximum value from a list of constants
74+ ### A. Return minimum value from a list of constants
7575
7676The following example returns the minimum value from the list of constants that is provided.
7777
@@ -82,7 +82,7 @@ SELECT LEAST('6.62', 3.1415, N'7') AS LeastVal;
8282GO
8383```
8484
85- [ !INCLUDE[ ssResult] ( ../../includes/ssresult-md.md )]
85+ [ !INCLUDE [ ssResult] ( ../../includes/ssresult-md.md )]
8686
8787``` output
8888LeastVal
@@ -101,7 +101,7 @@ SELECT LEAST('Glacier', N'Joshua Tree', 'Mount Rainier') AS LeastString;
101101GO
102102```
103103
104- [ !INCLUDE[ ssResult] ( ../../includes/ssresult-md.md )]
104+ [ !INCLUDE [ ssResult] ( ../../includes/ssresult-md.md )]
105105
106106``` output
107107LeastString
@@ -130,7 +130,7 @@ WHERE LEAST(P.SellStartDate, P.DiscontinuedDate, PM.ModifiedDate) >= '2007-01-01
130130ORDER BY P .Name ;
131131```
132132
133- [ !INCLUDE[ ssResult] ( ../../includes/ssresult-md.md )] ` EarliestDate ` chooses the least date value of the three values, ignoring ` NULL ` .
133+ [ !INCLUDE [ ssResult] ( ../../includes/ssresult-md.md )] ` EarliestDate ` chooses the least date value of the three values, ignoring ` NULL ` .
134134
135135``` output
136136Name SellStartDate DiscontinuedDate ModelModifiedDate EarliestDate
@@ -168,7 +168,7 @@ WHERE Correlation < LEAST(@PredictionA, @PredictionB);
168168GO
169169```
170170
171- [ !INCLUDE[ ssResult] ( ../../includes/ssresult-md.md )] Only values less than 0.65 are displayed.
171+ [ !INCLUDE [ ssResult] ( ../../includes/ssresult-md.md )] Only values less than 0.65 are displayed.
172172
173173``` output
174174VarX Correlation
@@ -204,7 +204,7 @@ FROM dbo.Studies;
204204GO
205205```
206206
207- [ !INCLUDE[ ssResult] ( ../../includes/ssresult-md.md )]
207+ [ !INCLUDE [ ssResult] ( ../../includes/ssresult-md.md )]
208208
209209``` output
210210VarX Correlation LeastVar
@@ -216,7 +216,7 @@ Var3 0.610 0.590
216216(3 rows affected)
217217```
218218
219- ## Next steps
219+ ## Related content
220220
221221- [ GREATEST (Transact-SQL)] ( ../../t-sql/functions/logical-functions-greatest-transact-sql.md )
222222- [ MAX (Transact-SQL)] ( ../../t-sql/functions/max-transact-sql.md )
0 commit comments