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


Popular posts from this blog

c# Service Play Sound with NAudio example by Moshe

Asp.Net Ending Response options, Response.End() vs CompleteRequest()

JS/JQ simulate Enter event