不会表达,看帖子内容吧!~~在线等,谢谢!
例:表1
lsh zzsl je
0523 17 10
0523 13 5
0523 0 40
0523 17 21
1526 13 9
... ...
问:我怎么样select 只有指定zzsl的?
比如说我只想select 表内一笔lsh只有13的
select * from 表1 where zzsl=13
但这样上面0523也会显示,我只要1526这样完全符合要求的。
------解决方案--------------------select * from [tb] a
where not exists(select 1 from lsh=a.lsh and zzsl<>a.zzsl) and zzsl=13
------解决方案--------------------select * from t2 a
where not exists(select 1 from t2 where lsh=a.lsh and zzsl<>a.zzsl)
------解决方案--------------------
select * from [tb] a
where not exists(select 1 from [tb] where lsh=a.lsh and zzsl<>a.zzsl) and zzsl=13