select * from 明细表 aa where not exists(select 1 from 计划表 bb where aa.钢种=bb.钢种 and aa.厚=bb.厚 and aa.宽 >=bb.宽度最小值 and aa.宽<=bb.宽度最大值 and aa.长 >=bb.长度最小值 and aa.长<=bb.长度最大值)
解决方案 »
- 写了一个存储过程,怎么用SQL语句查看写的代码呢?
- security admin可以reset password而不需要old password吗?
- SQL数据库换空间问题
- 可否不使用游标插入从其他表找来的资料?
- 我想DROP所有以“temp”开头的视图,语句怎么写呀?
- 怎样做被更新行的触发器
- 如何?调用数据库摸字段倒数第二个数据
- select a.* from tb a where 1 > (select count(*) from tb where name = a.name and
- 一个简单的SQL查询,请帮个忙,谢谢
- MS SQL Server链接DC Server查询数据的问题
- 关于计算“库存”的问题。
- 关于用中文命名的问题,大家说说看
on a.计划号=b.所属计划号 and a.钢种=b.钢种
and b.厚=a.厚 and a.宽度最小值<=b.宽 and
a.宽度最大值>=b.宽 and a.长度最小值<=b.长 and a.长度最大值>=b.长
not exists
(select * from 计划表 where 计划号 = A.所属计划号
and 钢种 = A.钢种 and 厚 = A.厚 and 宽度最小值 <= A.宽 and 长度最小值 <= A.长)
where not exists(select 1 from 计划表 B
where A.钢种=B.钢种 and A.厚=B.厚 and
A.宽 >B.宽度最小值 and A.宽<B.宽度最大值
and A.长 >B.长度最小值 and A.长<B.长度最大值)
( select * from 计划表 where 钢种 = a.钢种 and 厚 = a.厚
and a.宽 between 宽度最小值 and 宽度最大值
and a.长 between 长度最小值 and 长度最大值)
not exists
(select * from 计划表 where 计划号 = A.所属计划号
and 钢种 = A.钢种 and 厚 = A.厚 and 宽度最小值 <= A.宽 and 长度最小值 <= A.长)
not exists
(select * from 计划表 where 计划号 = A.所属计划号
and 钢种 = A.钢种 and 厚 = A.厚 and 宽度最小值 <= A.宽 and 长度最小值 <= A.长)