Where clause ones are just condition, and not joins:
its is just getting the latest extract date for each table e.g.
P.Data_date=(select max(P.Latest data date) from Patient Table (P) ) --- gets the latest extract date
AND T.Data_date==(select max(T.Latest data date) from Territory Table (T)) ------ gets the latest extract date
I need to have these condition to get the max date --