select max(a.col1) from table1 a,table b 
  where a.id=b.id and a.a = b.a;

解决方案 »

  1.   

    for example:
    SQL> select * from t1;         A          B
    ---------- ----------
            13         25
            22         16
            46         24SQL> select * from t2;         C          D
    ---------- ----------
            11         54
            44         22SQL> select max(a) from (select * from t1 union all select * from t2);    MAX(A)
    ----------
            46