I am trying to do an intersect query on two polygon layers in MapInfo. One is a buildings layer and the other are 2d mesh triangles. I want to get the max depth from any of the triangles that intersect the buildings layer. As multiple meshes intersect a single building polygon I end up with multiple entries of that building polygon in the background table, with each duplicate entry having a different depth corresponding to which triangle it intersects with.
Is there a way of automating the process so that I can have one buildings layer with the max depth for that building corresponding to the triangle (2d mesh) with the max depth?