col1|col2
0001|null
0002|null
0003|null
....|null
9999|null
T2表:col3
col3
f000
f001
f002
...
f9999 现欲将T1,T2表组合成
t1.col1,t2.col3
t1.col1|t2.col3
0001```|f001
0002```|f002
...
9999```|f9999 要怎么写SQL,是用在ORACLE。
T1,T2表间无任何关系,只是想把T2中该字段随机对进T1的COL2列中填空值而已,请问要怎么写SQL
0001|null
0002|null
0003|null
....|null
9999|null
T2表:col3
col3
f000
f001
f002
...
f9999 现欲将T1,T2表组合成
t1.col1,t2.col3
t1.col1|t2.col3
0001```|f001
0002```|f002
...
9999```|f9999 要怎么写SQL,是用在ORACLE。
T1,T2表间无任何关系,只是想把T2中该字段随机对进T1的COL2列中填空值而已,请问要怎么写SQL
from (select rownum rn, col1 from t1) t1 join
(select trunc(dbms_random.value(1,10000)) rn1, col3 from t2) t2
on(t1.rn = t2.rn1);
select a.*,b.*
from
(select rownum rn ,t1.* from t1)a,
( select rownum rn ,t2.* from t2)b
where a.rn=b.rn看哪表的行号多,相应的做左联或右联