split_part
Description
Syntax
VARCHAR split party (VARCHAR content, VARCHAR delimiter, INT field)
Returns the specified partition (counting from the beginning) by splitting the string according to the partitioner.
example
1. mysql> select split_part("hello world", " ", 1);
2. +----------------------------------+
3. | split_part('hello world', ' ', 1) |
4. +----------------------------------+
5. | hello |
6. +----------------------------------+
9. mysql> select split_part("hello world", " ", 2);
10. +----------------------------------+
11. | split_part('hello world', ' ', 2) |
12. +----------------------------------+
13. | world |
14. +----------------------------------+
16. mysql> select split_part("2019年7月8号", "月", 1);
17. +-----------------------------------------+
18. | split_part('2019年7月8号', '月', 1) |
19. +-----------------------------------------+
20. | 2019年7 |
21. +-----------------------------------------+
23. mysql> select split_part("abca", "a", 1);
24. +----------------------------+
25. | split_part('abca', 'a', 1) |
26. +----------------------------+
27. | |
28. +----------------------------+
keywords
1. SPLIT_PART,SPLIT,PART
