04.11.2018, 19:05
Hi! I have a problem in my sintax sql. I want to add a random phone number between 10000 and 99999. I have this query so far, but I'm failing to run it in the PHPMyAdmin
This is the error: #1064 - Something is wrong in its syntax near 'WHERE `NUM` NOT IN (SELECT` PHONE_NUMBER` FROM `PHONE`)' on line 1
Code:
SELECT round(RAND()*99999) AS `NUM` WHERE `NUM` NOT IN (SELECT `PHONE_NUMBER` FROM `PHONE`);