You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Return a substring from a string before the specified number of occurrences of the delimiter.
1289
+
The `SUBSTRING_INDEX()` function is used to extract a substring from a string based on a specified delimiter and count. This function is particularly useful when dealing with data separated by a specific delimiter, such as parsing CSV data or processing log files.
1290
+
1291
+
Syntax:
1292
+
1293
+
```sql
1294
+
SUBSTRING_INDEX(str, delim, count)
1295
+
```
1296
+
1297
+
-`str`: specifies the string to be processed.
1298
+
-`delim`: specifies the delimiter in the string, which is case-sensitive.
1299
+
-`count`: specifies the number of occurrences of the delimiter.
1300
+
- If `count` is a positive number, the function returns the substring before the `count` occurrences (counting from the left of the string) of the delimiter.
1301
+
- If `count` is a negative number, the function returns the substring after the `count` occurrences (counting from the right of the string) of the delimiter.
1302
+
- If `count` is `0`, the function returns an empty string.
Return the argument converted to a base-64 string.
1338
+
The `TO_BASE64()` function is used to convert the given argument to a string in the base-64 encoded form and return the result according to the character set and collation of the current connection. A base-64 encoded string can be decoded using the [`FROM_BASE64()`](#from_base64) function.
1339
+
1340
+
Syntax:
1341
+
1342
+
```sql
1343
+
TO_BASE64(str)
1344
+
```
1345
+
1346
+
- If the argument is not a string, the function converts it to a string before base-64 encoding.
1347
+
- If the argument is `NULL`, the function returns `NULL`.
0 commit comments