我要求我们的系统列出所有已发布优惠券的成员和所有尚未发布优惠券的用户。我制作了一个 SQL 脚本来提取已发布优惠券的成员列表。这是代码:
SELECT DISTINCT
b.Email,
b.FirstName,
b.LastName,
b.MemberDisplayName AS DisplayName,
b.MemberID
FROM ClassAd a
INNER JOIN Member b ON b.MemberID = a.MemberID
WHERE a.PostType = 'CPN'
AND DATEDIFF(d, 0, GETDATE()) <= a.ExpirationDate
AND a.Viewable = 'Y'
AND b.SystemID = 1
AND b.Claimed = 'Y'
AND b.Email IS NOT NULL
如何反转此脚本,使其仅拉出尚未发布优惠券的用户..?
任何帮助将不胜感激。