表pprstock字段如下: ID 产品名称 原料ID 类型
1 球节 12 合金
2 球节 13 毛坯
3 底座 10 合金
4 垫圈 11 钢材
5 大球 9 毛坯
请问如何得到如下的查询结果:ID 产品名称 原料ID 类型
3 底座 10 合金
4 垫圈 11 钢材
也就是说得到该表中所有不包含“毛坯”类型的产品信息
请问这个Sql语句如何写
1 球节 12 合金
2 球节 13 毛坯
3 底座 10 合金
4 垫圈 11 钢材
5 大球 9 毛坯
请问如何得到如下的查询结果:ID 产品名称 原料ID 类型
3 底座 10 合金
4 垫圈 11 钢材
也就是说得到该表中所有不包含“毛坯”类型的产品信息
请问这个Sql语句如何写
(select * from pprstock where a.产品名称=产品名称 and 类型='毛坯')
insert into @t select 1,'球节',12,'合金'
union all select 2,'球节',13,'毛坯'
union all select 3,'底座',10,'合金'
union all select 4,'垫圈',11,'钢材'
union all select 5,'大球',9,'毛坯'select * from @t a where not exists(select 1 from @t where 产品名称=a.产品名称 and 类型='毛坯')
select * from pprstock where 类型!='毛坯'