There is a table in which there is a point column with the coordinates of the point

I have the coordinates and dimensions of the rectangle (x, y, w, h), how to make a request so that all point that are included in this rectangle are sorted and output upwards?

    1 answer 1

    Use the MBRContains or MBRWithin function - in the described case they will give the same result.

    • As far as I understand, it displays the objects lying in the area, but I need to display ALL objects, and those that are sorted in the area and put into the top of the query - Fangog
    • I need something like order by MBRContains - Fangog
    • It is a valid construction - Akina
    • Can I make a query with sorting without specifying a region? Just so that the nearest points to the point displayed upwards, and the most distant ones to the reverse downward query? - Fangog
    • Perhaps this is another question, create a new thread - Fangog