Teja Teja - 1 year ago 156
SQL Question

Select @ before values

I want to select name in email



From that, I want to select

Answer Source

This is for MS SQL Server. You can easily replicate this if you use any other RDBMS

declare @email varchar(100)
set @email='sample@gmail.com'
select substring(@email,1,charindex('@',@email)-1)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download