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, 1INSTR(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

Popular posts from this blog

c# Service Play Sound with NAudio example by Moshe

JS/JQ simulate Enter event

SOLVED The item could not be indexed successfully because the item failed in the indexing subsystem