I want to write a query that generates a number 1 - 1000 and inserts it into an email address, where that email is an empty string. I know the syntax is off, but can MySQL generate a random number that I can insert into a string to create an email such as [email protected]?
The update statement I'm looking for would be a query like this:
UPDATE contacts SET email = 'na@na' + random_number(1-1000) + '.com' WHERE email = '';