openwrt 拨号设置:求助一个sql语句

来源:百度文库 编辑:中科新闻网 时间:2024/04/29 11:14:08
有两个表A、B,结构是一样的,假设某字段c,我想从A表中去掉A、B两个表中相同的记录,如下:
delete from A where exist in (select * from A,B where A.c=B.c)
我感觉这样写对,但是通不过,望高手指教~如有专门讲解sql语句的网站请留言~~非常感谢
delete from A where exists in (select * from B where
A.c=B.c)

shoory的答案基本正确,只要把exist改成exists

exists用法不是这样的,exists后边跟in是不对的。

去掉in就正确了。

delete from A where exists (select * from B where
A.c=B.c)

delete from a where a.c in(select b.c from b)

delete from A where exist in (select * from B where A.c=B.c)
这样试试