$min

$min

Welcome to our Knowledge Base

Documentation | Blog | Demos | Support

< All Topics
Print

$min

Returns the minimum value of a set of values.

Syntax

$min(expression)

Parameters

expressionany expression

Return Value

The value of the selected instance of expression.

Comments

Use $min to find the smallest value among members of a set. Instances of expression that are $Null are ignored.

Expression is often a WHERE expression that includes only selected values in the operation. If the WHERE expression (expr1 WHERE expr2) is true, the expr1 value is included in the operation; otherwise, expression is considered $Null and is ignored.

Example

compute Employees where DeptName = "Sales" 
  evaluate (let MaxSal = $max(Salary)) 
      (let MinSal = $min(Salary)) 
      (let MaxSalF = $max(Salary where Sex = "F")) 
      (let MinSalF = $min(Salary where Sex = "F"))

At the end of this operation, MaxSal contains the highest salary paid to any employee in Sales; MinSal contains the lowest salary paid to any employee in Sales; MaxSalF contains the highest salary paid to any female employee in Sales; and, MinSalF contains the lowest salary paid to any female employee in Sales.

See Also

$average

$count

$max

$total

About Functional Expressions

WHERE

Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

pt_BRPortuguese