【发布时间】:2012-08-29 09:48:13
【问题描述】:
您好,我需要使用 Criteria 执行以下操作
Select * from product pd, (Select productID pd1 from ... where ...) tpd1,
(Select productID pd2 from ... where ...) tpd2
where pd.productID = tpd1.pd1 and pd.productID = tpd1.pd2
请问可以吗?
原来的 SQL 使用的是 IN 条件
Select * from product pd where productID in (Select productID pd1 from ... where ...) and
productID in (Select productID pd2 from ... where ...)
但是得到结果的时间太长了,使用join SQL语句我能够更快地得到我的结果。
有什么帮助吗?
【问题讨论】:
-
请发布原始查询的解释计划。