Quote:
|
Originally Posted by Encantado
Because i have in total 9 product tables with each their own specific fields.
|
That is flawed logic and terrible db design. In situations like that you abstract out all fields into their own table and join them back into to one products table.
Anyways, if you want to achieve what you are asking in one query there are two ways to do it, a temporary table or a union command. Using a temp table you select all rows from both tables INTO the temp table them select back out then DROP the temp table. Union will only work if you select the same exact fields from each table.
Code:
SELECT id, name
FROM Saunas
WHERE visible = 1
UNION
SELECT id, name
FROM Spas
WHERE visible = 1
I would recommend updating your DB schema