BIN_TO_NUM |
Binaire à nombre |
---|---|
Oracle Database SQL |
Syntaxe
bin_to_num(vecteur) |
Paramètres
Nom | Description |
---|---|
vecteur | Ce paramètre permet d'indiquer une liste de paramètres de 0 ou de 1. |
Retour
Valeur | Description |
---|---|
0 ou supérieur | Ces valeurs permettent d'indiquer les valeurs correspondant à l'ensemble de bits. |
Description
Cette fonction permet de convertir un vecteur de bit en nombre.
Exemple
Voici un de valeurs consécutives :
- SELECT '0,0,0,1 = ' As Text,BIN_TO_NUM(0,0,0,1) AS Result FROM DUAL UNION
- SELECT '0,0,1,0 = ' As Text,BIN_TO_NUM(0,0,1,0) AS Result FROM DUAL UNION
- SELECT '0,0,1,1 = ' As Text,BIN_TO_NUM(0,0,1,1) AS Result FROM DUAL UNION
- SELECT '0,1,0,0 = ' As Text,BIN_TO_NUM(0,1,0,0) AS Result FROM DUAL UNION
- SELECT '0,1,0,1 = ' As Text,BIN_TO_NUM(0,1,0,1) AS Result FROM DUAL UNION
- SELECT '0,1,1,0 = ' As Text,BIN_TO_NUM(0,1,1,0) AS Result FROM DUAL UNION
- SELECT '0,1,1,1 = ' As Text,BIN_TO_NUM(0,1,1,1) AS Result FROM DUAL UNION
- SELECT '1,0,0,0 = ' As Text,BIN_TO_NUM(1,0,0,0) AS Result FROM DUAL UNION
- SELECT '1,0,0,1 = ' As Text,BIN_TO_NUM(1,0,0,1) AS Result FROM DUAL UNION
- SELECT '1,0,1,0 = ' As Text,BIN_TO_NUM(1,0,1,0) AS Result FROM DUAL UNION
- SELECT '1,0,1,1 = ' As Text,BIN_TO_NUM(1,0,1,1) AS Result FROM DUAL UNION
- SELECT '1,1,0,0 = ' As Text,BIN_TO_NUM(1,1,0,0) AS Result FROM DUAL UNION
- SELECT '1,1,0,1 = ' As Text,BIN_TO_NUM(1,1,0,1) AS Result FROM DUAL UNION
- SELECT '1,1,1,0 = ' As Text,BIN_TO_NUM(1,1,1,0) AS Result FROM DUAL UNION
- SELECT '1,1,1,1 = ' As Text,BIN_TO_NUM(1,1,1,1) AS Result FROM DUAL;
on obtiendra le résultat suivant :
TEXT | RESULT |
0,0,0,1 = | 1 |
0,0,1,0 = | 2 |
0,0,1,1 = | 3 |
0,1,0,0 = | 4 |
0,1,0,1 = | 5 |
0,1,1,0 = | 6 |
0,1,1,1 = | 7 |
1,0,0,0 = | 8 |
1,0,0,1 = | 9 |
1,0,1,0 = | 10 |
1,0,1,1 = | 11 |
1,1,0,0 = | 12 |
1,1,0,1 = | 13 |
1,1,1,0 = | 14 |
1,1,1,1 = | 15 |
Voir également
Article - Les géants de l'informatique - Oracle
Dernière mise à jour : Lundi, le 11 mai 2015