标题:[求助]关于一个Select语句的两个问题
取消只看楼主
C_B_Lu
Rank: 1
等 级:新手上路
威 望:1
帖 子:453
专家分:0
注 册:2006-1-10
 问题点数:0 回复次数:0 
[求助]关于一个Select语句的两个问题
SELECT *
FROM dbo.SampleInspect si
WHERE EXISTS
(
SELECT 1
FROM dbo.Project p
INNER JOIN dbo.Customer c
ON c.CustomerID = p.CustomerID
INNER JOIN dbo.SampleRevision sr
ON sr.PJ_RowID = p.PJ_RowID
INNER JOIN dbo.SampleReceive src
ON src.SR_RowID = sr.SR_RowID
INNER JOIN dbo.Supplier sp
ON sp.SupplierID = src.SupplierID
WHERE si.SRC_RowID = src.SRC_RowID
AND si.AddDate >= IsNull(@BeginDate, si.AddDate)
AND si.AddDate < DateAdd(day, 1, ISNULL(@EndDate, si.AddDate))
AND (p.SampleID = ISNULL(@SampleID, p.SampleID) OR sr.SampleRevID = ISNULL(@SampleID, sr.SampleRevID))
ANDp.CustomerID = ISNULL(@CustomerID, p.CustomerID)
)


问题一: Exists是不是也可以用IN关键字来代替?
问题二: "SELECT 1"中的"1"在语句中是什么意思?
搜索更多相关主题的帖子: Select 语句 
2007-06-06 22:15



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-145492-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.635581 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved