SOUNDEX (Lakehouse v1)
Génère le code Soundex d’une chaîne.
- Un code Soundex se compose d’une lettre suivie de trois chiffres. L’implémentation de PlaidCloud Lakehouse renvoie plus de 4 chiffres, mais vous pouvez appliquer SUBSTR au résultat pour obtenir un code Soundex standard.
- Tous les caractères non alphabétiques de la chaîne sont ignorés.
- Tous les caractères alphabétiques internationaux situés en dehors de la plage A-Z sont ignorés, sauf s’il s’agit de la première lettre.
Voir aussi : SOUNDS LIKE
Syntaxe Analyze
Section intitulée « Syntaxe Analyze »func.soundex(<str>)Exemples Analyze
Section intitulée « Exemples Analyze »func.soundex('PlaidCloud Lakehouse')┌──────────────────────────────────────┐│ func.soundex('PlaidCloud Lakehouse') │├──────────────────────────────────────┤│ D153 │└──────────────────────────────────────┘Syntaxe SQL
Section intitulée « Syntaxe SQL »SOUNDEX(<str>)Arguments
Section intitulée « Arguments »| Arguments | Description |
|---|---|
| str | La chaîne. |
Type de retour
Section intitulée « Type de retour »Renvoie un code de type VARCHAR ou une valeur NULL.
Exemples SQL
Section intitulée « Exemples SQL »SELECT SOUNDEX('PlaidCloud Lakehouse');
---D153
-- All non-alphabetic characters in the string are ignored.SELECT SOUNDEX('PlaidCloud Lakehouse!');
---D153
-- All international alphabetic characters outside the A-Z range are ignored unless they're the first letter.SELECT SOUNDEX('PlaidCloud Lakehouse,你好');
---D153
SELECT SOUNDEX('你好,PlaidCloud Lakehouse');
---你3153
-- SUBSTR the result to get a standard Soundex code.SELECT SOUNDEX('databend cloud'),SUBSTR(SOUNDEX('databend cloud'),1,4);
soundex('databend cloud')|substring(soundex('databend cloud') from 1 for 4)|-------------------------+-------------------------------------------------+D153243 |D153 |
SELECT SOUNDEX(NULL);┌─────────────────────────────────────┐│ `SOUNDEX(NULL)` │├─────────────────────────────────────┤│ <null> │└─────────────────────────────────────┘