0
조건부에 NOT EXISTS
절을 넣어야합니다. 아래에서SQL에서 NOT EXISTS 내부에서 where 절을 사용하는 방법은 무엇입니까?
내가 '2012-05-07이'와 SecurityId = '52211' 을하지만, 문제는 내부 조인 사용 = 날짜를 넣을 필요가 있고 내가있어 SQL 쿼리 아래 그에 대한 중복 기록을 체크 할 필요가 새 덧붙이는 방법을 얻지 못하는 곳에 절을 도와주세요.
SELECT DISTINCT
SecurityPriceId
FROM
dbo.Indicative Bond
INNER JOIN
dbo.BondPrice BondPrice ON
Indicative.SecurityId = BondPrice.SecurityId AND
BondPrice.SecurityPriceSourceId = @SecurityPriceSourceComposite
WHERE
Date = @Date -- Date='2012-05-07' like this
AND
NOT EXISTS
(
SELECT
'z'
FROM
dbo.Reporting_BondPrices
WHERE
Reporting_BondPrices.SecurityId = BondPrice.SecurityId AND
Reporting_BondPrices.Date = BondPrice.Date
--how can i put Date='2012-05-07' and SecurityId='52211'
)
내가 어떻게 할 수 있니? – Neo
? 그들은'어디에'안에 있습니다. – Blindy
업데이트 됨 내 질문에 도움이 필요하십시오. – Neo