MIN |
Minimum |
---|---|
Sybase |
Syntaxe
Min(argument) |
Paramètres
Nom | Description |
---|---|
argument | Ce paramètre permet d'indiquer que le champ devant être comparer. |
Description
Cette fonction retourne la plus basse valeur d'une liste d'argument.
Exemple
Voici un exemple permettant d'afficher les plus petites valeurs en contournant le problème qu'il n'accepte pas une liste de valeurs directement comme paramètre dans la fonction :
- SELECT 'MIN(5,-18)=' AS Text,min(X) AS Result FROM (SELECT 5 AS X UNION SELECT -18 AS X) AS TableData UNION
- SELECT 'MIN(0.25,0.115)=' AS Text, min(X) AS Result FROM (SELECT 0.25 AS X UNION SELECT 0.115 AS X) AS TableData UNION
- SELECT 'MIN(1,2,3,4,5)=' AS Text,min(X) AS Result FROM (SELECT 1 AS X UNION SELECT 2 AS X UNION SELECT 3 AS X UNION SELECT 4 AS X UNION SELECT 5 AS X) AS TableData UNION
- SELECT 'MIN(5,4,3,2,1)=' AS Text, min(X) AS Result FROM (SELECT 5 AS X UNION SELECT 4 AS X UNION SELECT 3 AS X UNION SELECT 2 AS X UNION SELECT 1 AS X) AS TableData UNION
- SELECT 'MIN(24,34,13,72,100,1,34)=' AS Text, min(X) AS Result FROM (SELECT 24 AS X UNION SELECT 34 AS X UNION SELECT 13 AS X UNION SELECT 72 AS X UNION SELECT 100 AS X UNION SELECT 1 AS X UNION SELECT 34 AS X) AS TableData
on obtiendra le résultat suivant :
Text | Result |
MIN(5,-18)= | -18.000 |
MIN(0.25,0.115)= | 0.115 |
MIN(1,2,3,4,5)= | 1.000 |
MIN(5,4,3,2,1)= | 1.000 |
MIN(24,34,13,72,100,1,34)= | 1.000 |
Voir également
Langage de programmation - Sybase - Référence de fonctions - AVG
Langage de programmation - Sybase - Référence de fonctions - MAX
Dernière mise à jour : Dimanche, le 31 mai 2015