I have three tables:
t_tbl
-----
t_id PK
t
p_tbl
-----
p_id PK
p
x_tbl
-----
x_id PK
x
t_id
p_id
My searches work separately:
Query 1:
SELECT x
FROM x_tbl xt
INNER JOIN
t_tbl tt
ON
xt.t_id = tt.t_id
Query 2:
SELECT x
FROM x_tbl xt
INNER JOIN
p_tbl pt
ON xt.p_id = pt.p_id
But I want to get xt.x
if xt.t_id = tt.t_id
OR
xt.p_id = pt.p_id