MYSQL: update record random 2 fixed char -


i update record on field want fill random either y or n

currently using:

update table1 set field1=( substring(md5(rand()) y n)

which not working

update table1 set field1 = case floor(1 + rand()*2) when 1 'y' else 'n' end; 

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -