I have set up a php page so there are multiple options for data input that gets put into multiple temporary tables, each one separated with querying the database based on 1 condition given in the data input. So if the input is age > 10 and shoesize > 6 and height > 60, there will be three temporary tables table0, table1, and table2 where table0 is only data age > 10 and table1 is only data shoesize > 6 and table 2 is only data height > 60.
I am wondering how to intersect these so I will only get the results that have all requirements met with age > 10 and shoesize > 6 and height > 60. My attempt using the "WHERE EXISTS" clause is below but it doesn't work.
SELECT *
FROM table0 t0
WHERE EXISTS
(SELECT *
FROM table1 t1
WHERE EXISTS
(SELECT *
FROM table2 t2
WHERE t0.age = t1.age = t2.age
AND t0.shoesize = t1.shoesize = t2.shoesize
AND t0.height = t1.height = t2.height));