select distinct docId from Wj a
where exists(select 1 from wj where docId=a.docId and type='公文')
and exists(select 1 from wj where docId=a.docId and type='通知')
where exists(select 1 from wj where docId=a.docId and type='公文')
and exists(select 1 from wj where docId=a.docId and type='通知')
解决方案 »
- SQL优化,请高手帮忙啊
- 跨数据库服务器的触发器问题!!急!!!!
- 数据库问题
- 这个语法如何理解?
- 用VB 和SQL SERVER做了个系统,在安全性登录里建立了一个SQL server身份的账号,不设置密码能登上去
- 请教高手 sql 如何两列变一列显示
- 事务日志错误(局域网)
- 初学,菜问题,别笑话我。
- 如何从Access数据库中读出所有的表,以及各表中各字段名称及类型,thank you
- 错误5180:由于文件ID3(位于数据库'fcdb'中)无效,所以未能打开fcb
- 允许其它SQL Server使用RPC远程连接到本SQL Server 的疑问
- 对于一个UNion查询,我想对于单个查询的结果排序,该怎么做呢
where type='公文' and exists(select 1 from Wj where docId=t.docId and type='通知')
where a.type='公文' and b.type='通知'