How to get the username from gmail and insert in the same table as different column in mysql [closed]
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
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.
add a comment |
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
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
add a comment |
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
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
mysql substring
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
update users set username="SUBSTRING_INDEX(email, "@", 1)";
This made the trick.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
update users set username="SUBSTRING_INDEX(email, "@", 1)";
This made the trick.
add a comment |
update users set username="SUBSTRING_INDEX(email, "@", 1)";
This made the trick.
add a comment |
update users set username="SUBSTRING_INDEX(email, "@", 1)";
This made the trick.
update users set username="SUBSTRING_INDEX(email, "@", 1)";
This made the trick.
answered Nov 16 '18 at 6:50
KayalKayal
212
212
add a comment |
add a comment |
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