I have point data within an MS SQL Server.
I can add it as a layer to QGIS by creating a DB connection under MS SQL Server and double clicking the table listed.
I also have a polygon layer again added via same MS SQL Server connection.
If I try and do Select by Location (or Select Within plugin) - asking for all points that are within the polygons - the result is that all points are selected not just the ones within the polygons:
But if I add the points layer as a Virtual layer (using same connection) the Select by Location works - only points within polygons selected:
Why? Surely it should work with the direct SQL connection method? What is the difference between virtual and direct SQL layer?