I’m facing the following problem:
I have a table (new_form) that lists units that should answer a formulary. The information about those units are in another table (units), including the code of city (city_code) where they are. I want to find the information in the first table (new_form) about all the units that are there and are located in an specific city (8383).
SELECT * FROM `new_form`
WHERE `unit_number`=(
SELECT `unit_number`
FROM `units`
WHERE `city_code`=8383
)
The way it is now, I get this error:
#1242 - Subconsulta retorna mais que 1 registro
Use
IN:Alternately, you could use a
JOIN: