您好我的查询正在运行,但我想从结果中删除某些值。
目前我有WHERE (pafaddresses.CountryName !="England")
,但我希望这是英格兰哪里不是威尔士,哪里不是威尔士,我不能让它为两个人工作!=陈述,我已经尝试过哪里!=&# 34;英国"或者"威尔士",没有任何成功。
任何帮助将不胜感激
SELECT
visits.VisitPk,
visits.ClientFk,
visits.ClientSiteFk,
visits.AssessorFk,
visits.VisitStartDate,
visits.VisitEndDate,
visits.Duration,
visits.VisitStatus,
visits.TargetDate,
CONCAT(MONTHNAME(TargetDate), ' ', YEAR(TargetDate)) AS TargetMonth,
pafaddresses.PostCode,
visits.`Long`,
visits.Lat,
pafaddresses.id,
pafaddresses.CountryName,
CONCAT(Clients.ClientName, ', ', clientsites.SiteName, ', ', MONTHNAME(TargetDate)) AS Description
FROM visits
INNER JOIN clientsites ON visits.ClientSiteFk = clientsites.ClientSitePk
LEFT OUTER JOIN pafaddresses ON clientsites.ActualPAF = pafaddresses.id
INNER JOIN Clients ON visits.ClientFk = Clients.ClientPk
WHERE (pafaddresses.CountryName !="England")
ORDER BY visits.TargetDate, visits.VisitStartDate
答案 0 :(得分:1)
您可以使用
执行此操作WHERE (pafaddresses.CountryName != 'England' AND pafaddresses.CountryName != 'Wales')
或
WHERE pafaddresses.CountryName NOT IN ('England', 'Wales')