create table tmain
(
one varchar(1),
two varchar(1)
)
create table tsec
(
first varchar(1),
second varchar(1)
)
insert into tmain values('1','1');
insert into tmain values('1','2');
insert into tmain values('2','1');
insert into tmain values('2','2');insert into tsec values ('1','1');
insert into tsec values ('2','2');
insert into tsec values ('3','3');如何在tmain中查出不在tsec表中存在的数据select a.* from tmain a, tsec b where (a.one=b.first) and (a.two=b.second)
的相反数据,即得到
one two
1 2
2 1
(
one varchar(1),
two varchar(1)
)
create table tsec
(
first varchar(1),
second varchar(1)
)
insert into tmain values('1','1');
insert into tmain values('1','2');
insert into tmain values('2','1');
insert into tmain values('2','2');insert into tsec values ('1','1');
insert into tsec values ('2','2');
insert into tsec values ('3','3');如何在tmain中查出不在tsec表中存在的数据select a.* from tmain a, tsec b where (a.one=b.first) and (a.two=b.second)
的相反数据,即得到
one two
1 2
2 1
解决方案 »
- 请教高手Fastreport3.0主从报表问题?
- 关于treeviewer的问题
- 周末散分
- dbgrid小问题求助
- 这个程序怎么写:
- 运行程序,出错:I/O error 102 是什么原因?
- 请教,关于函数CallBack的
- 请问如何利用adoquery(或query)实现对多表的更新(在线,给分多多)
- nmpop3怎么知道哪些是新邮件,哪些是已看过的邮件呢?
- 请问一个关于多窗体得问题,希望答复,很着急,也一定不麻烦,,求求大家了帮帮我!
- ////////////DBGrid 中,可不可以把DBGrid 的两列分别对应数据源。也就是一列对应一个数据源...//////
- Delphi7.0怎么没有报表工具呢?Delphi6里面有QReport在7里面怎么没有?
where not exists (select * from tsec b
where a.one=b.first and a.two=b.second);
JOIN tsec ON tmain.one = tsec.firs AND tmain.two = tsec.sec