我不是很清楚你的目的
看看这样 select 信息.name from 信息 where 信息.name not in (select distinct (库存.name) from 库存);
把库存中没有的药品名称找出来,再作你想做的事情
看看这样 select 信息.name from 信息 where 信息.name not in (select distinct (库存.name) from 库存);
把库存中没有的药品名称找出来,再作你想做的事情
解决方案 »
- ORACLE 中创建视图
- oracle 导入导出问题
- oracle 版本 搬迁 从Oracle8i 到 11g 需要注意些什么问题?
- !(在线等 !急呀!)oracle 启动 OMS失败的原因
- 老师要求写一篇关于oracle的paper,牛们,应该怎么写啊?
- 紧急求助一个SQL语句,快帮忙哦!!
- 谁能帮我做下优化
- 关于SQLpuls的使用(初学者)
- delphi中BDE连接ORACLE数据库后,控件query却不可用insert或edit进行插入操作?
- 高分求救:创建数据库时到90%的时候出现错误ora-03114 未连接到oracle呢,该怎样办?谢谢!
- 如何登陆到oracle management server上?
- 哪里邮介绍PS/SQL Developer的资料
是不是想找出一個表中的數據不在另一個表中,然後再insert呀?
例:
insert into table1 selct * from table2 where 信息 not in (select 信息 from table1 where ..).
用MIUS
SELECT * FROM TABLE1
MINUS
SELECT * FROM TABLE2;得到TABLE1里有的但在TABLE2里没有的。
是呀!我用以下语句:
insert into yaopkcxx values('c-01','select y.yaopbh from yaofypkcxx f,yaopxx y where y.yaopbh=f.yaopbh and y.材质分类=‘中成药’',0,0,0,0,0,100000,0)
但提示:select语句没有完成。
我用select y.yaopbh from yaofypkcxx f,yaopxx y where y.yaopbh=f.yaopbh and y.材质分类=‘中成药语句查询时查到192条记录。
insert into tab1
SELECT * FROM TABLE1
MINUS
SELECT * FROM TABLE2;
两个表的字段不一样,yaofypkxcc表中只用一个yaopbh字段。
非常不错,谢谢。