如何从查询搜索中的列中排除某些值

时间:2016-02-09 18:59:03

标签: sql sql-server

我试图排除未在查询搜索中映射的任何条目,我在网上看到了一个例子,但我想我正在咆哮错误的树。

enter image description here

SELECT 
LocationID, LocationAddress 
FROM tblLawncare 
WHERE ISNULL(Hide,0) = 0 
AND LocationAddress 
IS NOT Not Mapped  
ORDER BY LocationID

2 个答案:

答案 0 :(得分:2)

你是说这个?

SELECT 
LocationID, LocationAddress 
FROM tblLawncare 
WHERE ISNULL(Hide,0) = 0 
AND LocationAddress <> 'not mapped'
ORDER BY LocationID

答案 1 :(得分:1)

SELECT 
LocationID, LocationAddress 
FROM tblLawncare 
WHERE ISNULL(Hide,0) = 0 
AND LocationAddress <> 'not mapped' 
ORDER BY LocationID

虽然我不确定你的WHERE ISNULL(Hide, 0) = 0应该做什么。什么是Hide