in mysql there is
which means :

Returns the substring from string str before count occurrences of the delimiter delim. If count is positive, everything to the left of the final delimiter (counting from the left) is returned. If count is negative, everything to the right of the final delimiter (counting from the right) is returned.
mysql> SELECT SUBSTRING_INDEX('', '.', 2);
-> 'www.mysql'
mysql> SELECT SUBSTRING_INDEX('', '.', -2);
-> ''
is there something like this in a query to access?