I’ve three table ‘Hardware_model’,’Warehouse’ and ‘Brand’ and tables are refernced together in this way:
Hardware_model <-> Warehouse
Hardware_model <-> Brand
Now I want execute the following query: select all ‘warehouse’ object that has a ‘brand_id equal to ’10’). Off course warehouse and brand are not joined so no foreign keys exists between them. I was trying something like:
SELECT *
FROM warehouses
where hardware_id = (SELECT *
FROM hardwares
where brand_id='10')
but it doesn’t works!
where hardware_id is a ‘warehouse table’ field and brand_id is a ‘hardware table’ field.
Any suggestions?
This sounds like a simple multi-table join. You just need to do something along the lines of (I can only guess the table structure).