I have this sql
select concat( char(FLOOR(97+ RAND()*26))
, char(FLOOR(97+ RAND()*26))
, FLOOR(100+ RAND()*999)
, char(FLOOR(97+ RAND()*26))) AS randomcode
WHERE NOT EXISTS (
SELECT *
FROM table
WHERE code_felt = randomcode );
But I can't get it to work. Does somebody know what I am doing wrong here?
I need to make a 6 chart code in random and it does not exists in my code. I hope I can be helped.