Support Topics Documentation Slack YouTube Blog

Delete not related GEO Points


(Martin Krajčír) #1

I have a relation from DATA Table to geo point. Now I want to remove all odd geo points without relation from data table? How can I do it from the backendless web console?

I need to run SQL like this:


DELETE FROM GeoCategory WHERE id NOT IN (
  SELECT t.id
  FROM (
    SELECT d.id
    FROM mydata d
      LEFT JOIN GeoCategory geo ON geo.id = d.geo
  ) as t
);

Thank you.


(Sergey Chupov) #2

Hi Martin,

This is the where clause to find those geo points:

YourDataTable[relationColumnName].objectId IS NULL

(reference: https://backendless.com/docs/rest/doc.html#data_inverted_relation_retrieval)

You may delete them from console or from your code using API.


(Martin Krajčír) #3

Hello Segey,

unfortunately your suggested solution could be used to delete DataTable items. But I need to remove GeoPoint items.


(Sergey Chupov) #4

You can search geo points using where clause, too.


(Martin Krajčír) #5

Thank you Sergey, I did not know that. So here is a documentation how to operate over geo point.