a spiceworks posting से समझे:
The first step is to remove all characters up to a specific character using ltrim or rtrim. If you're retrieving a filename then you trim all characters that are not slashes. If you're retrieving a username then you trim everything that is not an @ character. You can then use that trimmed string in a replace function to replace its occurrence with an empty string. That will provide you with every character that you just trimmed in the first step. In other words, the username or filename.
create table example (path varchar(256), email varchar(128));
insert into example values ('/path/to/file1.txt', '[email protected]');
Retrieve user from email:
select replace(email, ltrim(email, '1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM!#$%^&*()_+-=`~[]\/{}|;:,.<>?'),'') from example;
स्रोत
2012-10-16 16:25:35
क्या आप अपना समाधान – Odys