SQL Server : spatial query result are not showing

104 views Asked by At
SELECT Distinct lu.ObjectID
FROM LAND_USE_EVW as lu
WHERE NOT EXISTS (SELECT LAND_USE_EVW.OBJECTID 
                  FROM LAND_USE_EVW, MUNICIPALITIES_EVW 
                  WHERE LAND_USE_EVW.Shape.STCentroid().STIntersects(MUNICIPALITIES_EVW.shape) = 1
                 )

I was trying to get a result that opposite of below

select LAND_USE_EVW.OBJECTID 
    from LAND_USE_EVW, MUNICIPALITIES_EVW 
    where    LAND_USE_EVW.Shape.STCentroid().STIntersects(MUNICIPALITIES_EVW.shape) = 1

= 0 didn't work therefore I'm trying to come up with other idea.

But result shows nothing. No errors or warning.

1

There are 1 answers

0
Minnu P On

found answer

WHERE NOT EXISTS (SELECT LAND_USE_EVW.OBJECTID 
FROM LAND_USE_EVW, MUNICIPALITIES_EVW 

removing LAND_USE_EVW from FROM LAND_USE_EVW solve the problem