Hi, Need a query help. I have a table in which a column is having the mailid like abc@xyz.com. Now I want to extract the name of all records in mailid column. Suggest some query so that my result should have the all data before of '@' symbol. Regards Ashish Kuriyal
try this: declare @t1 table(col1 varchar(50)) insert @t1 select 'abc@xyz.com' union all select 'sql.query@2000.com' select left(col1,charindex('@',col1)-1) from @t1