這是一個非常簡單的查詢:where子句沒有返回
select br.BranchCode, br.BranchName,cn.Country, cd.AggregateCreditExposure as [CreditExposure]
from Branches br join CreditDetails cd
on br.BranchCode = cd.BranchCode join Country cn
on br.CountryCode = cn.CountryCode
,這讓我對結果集:
當我試圖把where
條款,它不返回結果:
select br.BranchCode, br.BranchName,cn.Country, cd.AggregateCreditExposure as [CreditExposure]
from Branches br join CreditDetails cd
on br.BranchCode = cd.BranchCode join Country cn
on br.CountryCode = cn.CountryCode
where cn.Country = 'France'
預期結果:
奇怪的是,它什麼都沒有返回。爲什麼它不起作用?
架構的Country
:(只提供相關表格)
COUNTRYCODE INT PK
國家VARCHAR(50)
也許你有空格或其他不可見字符數據。 –
當你使用'where cn.Country LIKE'France%''時會發生什麼? – LittleBobbyTables
@TabAlleman不,我試過很多國家。我確信沒有打字錯誤 – Shaharyar