MySQL IndexOf and Substring example
example to select the name only
SELECT INSTR('ariel@lti', '@');
SELECT SUBSTRING('MySQL Substring',7,3);
SELECT Name, Email ,
INSTR(Email, '@') as indx,
SUBSTRING(Email, 1, INSTR(Email, '@')-1) as wow ,
SUBSTRING(Email, 1, 9) AS nooo
FROM supplier_contact WHERE name='No Info';
example to select the domain only
SELECT SUBSTRING(Email, INSTR(Email, '@')+1, LENGTH(Email)) AS domain, Email
FROM supplier_contact
SELECT INSTR('ariel@lti', '@');
SELECT SUBSTRING('MySQL Substring',7,3);
SELECT Name, Email ,
INSTR(Email, '@') as indx,
SUBSTRING(Email, 1, INSTR(Email, '@')-1) as wow ,
SUBSTRING(Email, 1, 9) AS nooo
FROM supplier_contact WHERE name='No Info';
example to select the domain only
SELECT SUBSTRING(Email, INSTR(Email, '@')+1, LENGTH(Email)) AS domain, Email
FROM supplier_contact
Comments
Post a Comment