Oracle, specifically. I need to do the following in SQL in a declarative query, without defining a variable or if condition. Consider the following SQL:

```
    SELECT * 
    FROM table1
    JOIN table2 on table2.a = table1.a
    WHERE table1.d = 4 
    AND c = (select c from table3 where b=3);

```

The catch is, if there is NOT a match in table3, then instead of table3 limiting the rows , the table3 condition should not apply (effectly just removing the last line of the above query)

How can I do that in a single SQL statement without defining a variable first?