sql - get random code not exists mysql -
I have this SQL
select the contact (four (flo (97+ rand) * 26)), four (floor (97+ rand (* * 26)), floor (100+ rand (* 99), four (floor (97+ rand (* 26))) in the form of random ARS Does not exist SELECT * from table WHERE code_felt = randomcode);
But I can not get it to work. Does anyone know what I am doing wrong here?
I need to create 6 chart codes in random and it is not present in my code. I hope I can get help.
You have to select from anywhere, your selection does not have a table name, since you actually get random from a table Do not select the values, so you should use the DUAL (this is a 'fake' table):
Choose CONNAT (char (97+ RAND) * 26), random from dual In the form of code (select * from table * where code_felt = randomcode), four (97 + rand () * 26), bottom (100 + rand (* 900 *), four (97+ rand (* * 26)) );
This will sometimes select a record, sometimes no record. If this does not pick any record, you will need to repeat the query, I can not always think of it a way to select a record.
Comments
Post a Comment