I have this query:
update sales_flat_quote set customer_email = (concat(select substring(md5(rand()) from 1 for 20), '@example.com'));
It gives me this error: 3 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 6 SQL1.sql 6 1. I want to concat the results from the substring select with the static @example.com string.
Whats wrong with the query?
Thanks!
select substring(md5(rand()) from 1 for 20returns a result set, not a string.The proper way to do what you want would be
update sales_flat_quote set customer_email = (concat(substring(md5(rand()) from 1 for 20), '@example.com'));