I have table `TableLL` which stores longitude and latitude, first 10 row as shown below:

```
Latitude    Longitude   ID
---------------------------
52.239215   -0.927128   1
52.627201   -1.701828   2
53.413624   -2.151294   3
52.402537   -1.519893   4
52.991135   -2.411111   5
53.409981   -2.598566   6
52.596913   -2.090278   7
52.041275   -0.777819   8
53.196655   -2.909875   9
52.945638   -1.13321    10

```

and I can count rows in different table (`MainTable`) for one latitude and one longitude from `tableLL` by using this query :

```
SELECT 
    Month, Crime_type, count(*) as TOTAL
FROM 
    MainTable
WHERE 
    ABS(MainTableLongitude - (SELECT Longitude
                              FROM TableLL
                              WHERE ID = 1)) < 0.014347 
    AND ABS(MainTableLongitude - (SELECT Latitude 
                                  FROM TableLL
                                  WHERE ID = 1)) < 0.023033
GROUP BY 
    Crime_type,MONTH

```

and result is:

```
Month      Crime_type   TOTAL
-----------------------------
2015-04     ASB         326
2015-04     Burglary     44
2015-04     CDA          50
2015-05     ASB         126
2015-05     Burglary     21
2015-05     CDA           3
2015-06     ASB          14
2015-06     Burglary      7
2015-06     CDA          58

```

But I want to count results by using all latitude and longitude in `TableLL` (I have to compare every row from `TableLL` with `MainTable`'s values in the `WHERE` clause). Any ideas?