怎样把两个不同数据库中的表做关联查询呢?
1、创建产品及订单两张测试表,
create table test_product(prodid number, prodname varchar2(200));
create table test_order(orderid number, prodid number);
2、插入产品表测试数据
insert into test_product values(1001,'玩具');
insert into test_product values(1002,'书本');
insert into test_product values(1003,'收集');
3、插入订单表测试数据
insert into test_order values(1,1001);
insert into test_order values(2,1002);
insert into test_order values(3,1001);
insert into test_order values(4,1001);
4、编写sql,关联产品表prodid与订单表prodid,
select * from TEST_order t, test_product b
where t.prodid = b.prodid,
2024-06-11 广告