Turn Emails into Usernames With MySQL Query
I'd probably suggest doing it in the code that will be creating the insert statement but it can be done in the insert statement itself too.

INSERT INTO yourtable SET username = LOWER(SUBSTR(useremail,1,LOCATE('@',useremail) - 1))


I included the LOWER so the style of the user name would be consistent in case a person entered their email address in MixedCase.