can someone please tell me what is wrong with the following query
select 1 
from table1 a, 
table2 b 
where a.pdate=max(b.pdate)
It is not compiled.
the other way to write this query is
set @pdate=pdate from table2
select 1 
from table1 a, 
table2 b
where a.pdate=max(b.pdate)
But I want to understand what is wrong with the first query.
Thanks
 
     
     
    