34,838
社区成员




1.建立一个一模一样的数据表,就数据表名不一样?
select * into tb1 from tb2 where 1=0
2如果我想左连接查2个表中book_num不一样的记录,请问如何实现,
select * from t1 where id not in(select id from t2)
or
select * from t2 where id not in(select id from t1)
1.建立一个一模一样的数据表,就数据表名不一样?
select * into tb1 from tb2
2.如何合并查询,如何查不符合条件的记录....例如:
select a.*,b.bj,b.i_date from book1 a left outer join book2 b on a.book_num=b.book_num
上面这句是查询,是左连接查询a表和b表中book_num相同的记录,如果我想左连接查2个表中book_num不一样的记录,请问如何实现,谢谢!
select a.* from book1 where book_num not in (select book_num from book2)
select a.* from book2 where book_num not in (select book_num from book1)