select min(id) , (select min(id) from B) from A
如题,能实现吗?
------解决方案--------------------
select min(a.id) , min(t.id) from A,(select min(id) id from B) t;
------解决方案--------------------直接写呢
select min(A.id) ,min(B.id)
from A,B
------解决方案--------------------
SQL> select min(id),(select min(id) from t2) from t1;
select min(id),(select min(id) from t2) from t1
*
第 1 行出现错误:
ORA-00937: 不是单组分组函数
SQL> select min(id),(select min(id) from t2) from t1 group by 2;
MIN(ID) (SELECTMIN(ID)FROMT2)
---------- ---------------------
1 1
如果像LZ那样写是不可以实现的。min(id)和(select min(id) from B)不是门当户对的一对儿。