Try this but check change the column name and table as you have in database.
For specific review id:
Select * from table1 a
Inner join table2 b ON a.id = b.review_id
WHERE ( b.is_verified IS NULL OR b.is_verified = 1) AND a.id = 5049
For all reviews:
Select * from table1 a
Inner join table2 b ON a.id = b.review_id
WHERE ( b.is_verified IS NULL OR b.is_verified = 1);
If one of them 0 skip record:
Select * from table1 a
Inner join table2 b ON a.id = b.review_id
WHERE
AND b.is_verified != 0
AND a.id = 5049
Anti JOIN EXAMPLE (will skip all others):
SELECT t1.*
FROM Table1 AS t1
WHERE NOT EXISTS
( SELECT *
FROM Table2 AS t2
WHERE t2.reviewer_id = t1.id
AND t2.is_verified = 0
)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…