SQL 中 in 条件的改造 应用中有这样一个查询:select * from document_history where document_id in (select document_id from document_reports where ...)这里如果 in 中的子查询数据很多是不是会有性能问题?该如何改造? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from document_history a inner join document_reports b on a.document_id = b.document_idwhere b..... = ...(条件) select * from document_history a where exists(select 1 from document_reports where document_id=a.document_id) 两个表的document_id需要索引优化 我写SQL都不用IN的..都用JOIN或EXISTS 最好用left join,inner join或者exists用IN查询速度慢 请教一条sql语句的写法 取小于当前值的最大值的那条记录. 的sql 怎么写 求一SQL语句! 业务报表设计和调优问题 请教几个尖锐的问题? 请教sql server 2005安装问题 跪求解答数据库设计问题 text字段! 如何用目录保存照片(高分!!) 有办法恢复删错的数据吗 请问斑竹和各位高手,如何用sql语句实现,查询第m笔到第n笔资料??????急急急急 怎么连接SQL数据库---应用在登陆窗体 把一列nvarchar都转换成int
select * from document_history a
inner join document_reports b on a.document_id = b.document_id
where b..... = ...(条件)
(select 1 from document_reports where document_id=a.document_id)
用IN查询速度慢