17,377
社区成员
发帖
与我相关
我的任务
分享
SQL> create table tb1(id number,col1 varchar2(10));
Table created.
SQL> create table tb2(id varchar2(5),col1 varchar(10));
Table created.
SQL> insert into tb1(id, col1) values( 1,'A');
1 row created.
SQL> insert into tb1(id,col1) values(2,'B');
1 row created.
SQL> insert into tb2(id,col1) values(1,'AA');
1 row created.
SQL> insert into tb2(id,col1) values(2,'BB');
1 row created.
SQL> select * from tb1,tb2 where tb1.id = tb2.id;
ID COL1 ID COL1
---------- ---------- ----- ----------
1 A 1 AA
2 B 2 BB
--也可以实现显示转换
SQL> select * from tb1,tb2 where to_char(tb1.id) = tb2.id;
ID COL1 ID COL1
---------- ---------- ----- ----------
1 A 1 AA
2 B 2 BB