Fixes #20674 - DB Manager - load sql query as layer with geom column Well, not sure it really fixes that particular issue because it is not really well described, but for sure this fixes the general case of "SELECT * FROM my_table AS my_alias"