Skip to content

Commit 5de5806

Browse files
authored
Update left.md (#1698)
1 parent b6f53f9 commit 5de5806

File tree

1 file changed

+9
-8
lines changed
  • docs/en/sql-reference/20-sql-functions/06-string-functions

1 file changed

+9
-8
lines changed

docs/en/sql-reference/20-sql-functions/06-string-functions/left.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: LEFT
33
---
44

5-
Returns the leftmost len characters from the string str, or NULL if any argument is NULL.
5+
Returns the leftmost `len` characters from the string `str`, or NULL if any argument is NULL. If `len` is greater than the length of `str`, the entire `str` is returned.
66

77
## Syntax
88

@@ -24,10 +24,11 @@ LEFT(<str>, <len>);
2424
## Examples
2525

2626
```sql
27-
SELECT LEFT('foobarbar', 5);
28-
+----------------------+
29-
| LEFT('foobarbar', 5) |
30-
+----------------------+
31-
| fooba |
32-
+----------------------+
33-
```
27+
SELECT LEFT('foobarbar', 5), LEFT('foobarbar', 10);
28+
29+
┌──────────────────────────────────────────────┐
30+
│ left('foobarbar', 5) │ left('foobarbar', 10) │
31+
├──────────────────────┼───────────────────────┤
32+
│ fooba │ foobarbar │
33+
└──────────────────────────────────────────────┘
34+
```

0 commit comments

Comments
 (0)