Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql extract from mail

-- FROM admin@system.org
SELECT 
--admin
LEFT(emailAddres, CHARINDEX('@', emailAddres) - 1) AS accountName  

--system.org
RIGHT(emailAddres, LEN(emailAddres) - CHARINDEX('@', emailAddres)) AS domainWithExtension

--system
LEFT(RIGHT(emailAddres, LEN(emailAddres) - CHARINDEX('@', emailAddres)), CHARINDEX('.', RIGHT(emailAddres, LEN(emailAddres) - CHARINDEX('@', emailAddres))) - 1) AS domain

--org
RIGHT(RIGHT(emailAddres, LEN(emailAddres) - CHARINDEX('@', emailAddres)), LEN(RIGHT(emailAddres, LEN(emailAddres) - CHARINDEX('@', emailAddres))) - CHARINDEX('.', RIGHT(emailAddres, LEN(emailAddres) - CHARINDEX('@', emailAddres)))) AS extension
Comment

PREVIOUS NEXT
Code Example
Sql :: sql server add time to date 
Sql :: activate log mysql 
Sql :: else if mysql 
Sql :: add multiple row table pl sql 
Sql :: with postgres 
Sql :: alter table add check constraint oracle 
Sql :: truncate all tables 
Sql :: sql select count distinct 
Sql :: SQL Server Altering Column to be Unique 
Sql :: how to get the date diff of 2 dates in the same fieldin sql server 
Sql :: mysql query with sql to get the next row 
Sql :: mysql date equals to current_date plus days 
Sql :: insert snowflake 
Sql :: installing mysql on centos 7 
Sql :: get max salary from each department sql 
Sql :: how to remove unique key in mysql 
Sql :: sql select min row 
Sql :: influxdb list all tags for a measurement 
Sql :: intellij mysql set timezone 
Sql :: SQL Duplicates by Composite 
Sql :: sql find second highest salary employee 
Sql :: alter table add foreign key mariadb example 
Sql :: mysql auto increment column 
Sql :: sql select where clause 
Sql :: show details of table postgres 
Sql :: eliminar ultimo carcacter mysql 
Sql :: postgres left join 
Sql :: default value false mysql 
Sql :: truncate table in sql 
Sql :: mysql create table index 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =