Camillia
asked on
Why does this SQL bring back null?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This should work:
SELECT DISTINCT SiteAddress ,
sitecity ,
SiteState ,
SiteZip ,
SiteCountryCode
FROM tableName
WHERE Deleted = 0
AND SiteCountryCode = 'USA'
OR SiteAddress IS NOT NULL;
ASKER
Has to be "AND" or I'd still get null
SELECT DISTINCT SiteAddress,sitecity,SiteS tate,SiteZ ip,SiteCou ntryCode
FROM table
WHERE (Deleted =0 AND SiteCountryCode = 'USA')
and (SiteAddress IS not NULL)
SELECT DISTINCT SiteAddress,sitecity,SiteS
FROM table
WHERE (Deleted =0 AND SiteCountryCode = 'USA')
and (SiteAddress IS not NULL)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Got it. Thanks, guys.
ASKER
Open in new window
This seems to be correct
SELECT DISTINCT SiteAddress,sitecity,SiteS
FROM table
WHERE (Deleted =0 AND SiteCountryCode = 'USA')
and (SiteAddress IS not NULL)
---