| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛

create cursor b1 (jnh n(1),mc c(3))
insert into b1 values (1,"ab")
insert into b1 values (2,"abc")
insert into b1 values (3,"ac")
insert into b1 values (4,"bc")
insert into b1 values (5,"A5")

create cursor b2 (jnh n(1),mc c(2))
insert into b2 values (1,"ab")
insert into b2 values (2,"aba")
insert into b2 values (3,"a")

SELECT * FROM b1 WHERE ALLTRIM(mc) in (SELECT ALLTRIM(mc) FROM b2)

select * from b1,b2 where alltrim(b1.mc)==alltrim(b2.mc)

select * from b1 inner join b2 on alltrim(b1.mc)==alltrim(b2.mc)

create cursor b2 (jnh n(1),mc c(2))
insert into b2 values (2,"aba")

[此贴子已经被作者于2021-11-21 21:00编辑过]

create cursor b2 (jnh n(1),mc c(2))
insert into b2 values (2,"aba")

[此贴子已经被作者于2021-11-22 09:13编辑过]

create cursor b1 (jnh n(1),mc c(3))
insert into b1 values (1,"ab")
insert into b1 values (2,"abc")
insert into b1 values (3,"ac")
insert into b1 values (4,"bc")
insert into b1 values (5,"A5")

create cursor b2 (jnh n(1),mc c(3))
insert into b2 values (1,"ab")
insert into b2 values (2,"aba")
insert into b2 values (3,"a")

select b1.jnh,b1.mc from b1,b2 where b1.mc==b2.mc

select * from b1,b2 where alltrim(b1.mc)==alltrim(b2.mc)

select b1.* from b1,b2 where alltrim(b1.mc)==alltrim(b2.mc)

select b2.* from b1,b2 where alltrim(b1.mc)==alltrim(b2.mc)

b1有b2没有
select * from b1 where mc not in (select mc from b2)

b2有b1没有
select * from b2 where mc not in (select mc from b1)

select * from b1,b2 where alltrim(b1.mc)==alltrim(b2.mc)

select b1.* from b1,b2 where alltrim(b1.mc)==alltrim(b2.mc)

select b2.* from b1,b2 where alltrim(b1.mc)==alltrim(b2.mc)

b1有b2没有
select * from b1 where mc not in (select mc from b2)

b2有b1没有
select * from b2 where mc not in (select mc from b1)

• 10
• 1/1页
• 1