I have the below query which is giving correct output when the t2.date is not null
select t1.name,t1.work,t2.type from t1,t2 where t.name=t2.name and t1.postdate < t2.date
But when the t2.date is null the query is not fetching any rows. So I want to add the t1.postdate < t2.datecondition only when the t2.date is not null.
When the t2.date is null I don't want to add it to the query(I want the output as the above query gives without and condition)
select t1.name,t1.work,t2.type from t1,t2 where t.name=t2.name
Please help me with this. Thanks in advance.