how to get index of in sql server? Ask Question
By   Adil Shahbaz     14-Jul-2024    1

I have an field with name email like "abcd@abc.com"

I want to get first text of @ which is "abcd" and set it into another field username.

Solutions


Nawab

You get this by using LEFT and CHARINDEX

 

SELECT LEFT('abcd@abc.com, CHARINDEX('@', 'abcd@abc.com') - 1) AS username

10033
Copyright Future Minutes © 2015- 2024 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM