How to get the username from gmail and insert in the same table as different column in mysql [closed]










0















I have a table named users. I have their email id in email column as "kayal@gmail.com", "suresh@yahoo.com", etc. I need a sql query to save the username(splitted from the email column like kayal, suresh, etc) column in the same existing table. How can I do this?










share|improve this question













closed as too broad by Madhur Bhaiya, Strawberry, Owen Pauling, James Coyle, greg-449 Nov 16 '18 at 10:12


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • 4





    Possible duplicate of strip name from email in mysql without php is it possible?

    – snipsnipsnip
    Nov 16 '18 at 6:47











  • Yes. I got it. Thanks

    – Kayal
    Nov 16 '18 at 6:49















0















I have a table named users. I have their email id in email column as "kayal@gmail.com", "suresh@yahoo.com", etc. I need a sql query to save the username(splitted from the email column like kayal, suresh, etc) column in the same existing table. How can I do this?










share|improve this question













closed as too broad by Madhur Bhaiya, Strawberry, Owen Pauling, James Coyle, greg-449 Nov 16 '18 at 10:12


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • 4





    Possible duplicate of strip name from email in mysql without php is it possible?

    – snipsnipsnip
    Nov 16 '18 at 6:47











  • Yes. I got it. Thanks

    – Kayal
    Nov 16 '18 at 6:49













0












0








0








I have a table named users. I have their email id in email column as "kayal@gmail.com", "suresh@yahoo.com", etc. I need a sql query to save the username(splitted from the email column like kayal, suresh, etc) column in the same existing table. How can I do this?










share|improve this question














I have a table named users. I have their email id in email column as "kayal@gmail.com", "suresh@yahoo.com", etc. I need a sql query to save the username(splitted from the email column like kayal, suresh, etc) column in the same existing table. How can I do this?







mysql substring






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 16 '18 at 6:42









KayalKayal

212




212




closed as too broad by Madhur Bhaiya, Strawberry, Owen Pauling, James Coyle, greg-449 Nov 16 '18 at 10:12


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









closed as too broad by Madhur Bhaiya, Strawberry, Owen Pauling, James Coyle, greg-449 Nov 16 '18 at 10:12


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









  • 4





    Possible duplicate of strip name from email in mysql without php is it possible?

    – snipsnipsnip
    Nov 16 '18 at 6:47











  • Yes. I got it. Thanks

    – Kayal
    Nov 16 '18 at 6:49












  • 4





    Possible duplicate of strip name from email in mysql without php is it possible?

    – snipsnipsnip
    Nov 16 '18 at 6:47











  • Yes. I got it. Thanks

    – Kayal
    Nov 16 '18 at 6:49







4




4





Possible duplicate of strip name from email in mysql without php is it possible?

– snipsnipsnip
Nov 16 '18 at 6:47





Possible duplicate of strip name from email in mysql without php is it possible?

– snipsnipsnip
Nov 16 '18 at 6:47













Yes. I got it. Thanks

– Kayal
Nov 16 '18 at 6:49





Yes. I got it. Thanks

– Kayal
Nov 16 '18 at 6:49












1 Answer
1






active

oldest

votes


















2














update users set username="SUBSTRING_INDEX(email, "@", 1)";
This made the trick.






share|improve this answer





























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    update users set username="SUBSTRING_INDEX(email, "@", 1)";
    This made the trick.






    share|improve this answer



























      2














      update users set username="SUBSTRING_INDEX(email, "@", 1)";
      This made the trick.






      share|improve this answer

























        2












        2








        2







        update users set username="SUBSTRING_INDEX(email, "@", 1)";
        This made the trick.






        share|improve this answer













        update users set username="SUBSTRING_INDEX(email, "@", 1)";
        This made the trick.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 16 '18 at 6:50









        KayalKayal

        212




        212















            Popular posts from this blog

            Top Tejano songwriter Luis Silva dead of heart attack at 64

            ReactJS Fetched API data displays live - need Data displayed static

            Evgeni Malkin