<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
I am new to PostGIS and trying to learn how everything works. I am using Introduction to PostGIS site data to test different GIS function including spatial join. The spatial join SQL statement seems to work [<span style="color: rgb(200, 38, 19);">SELECT * FROM
 nyc_neighborhoods AS n JOIN nyc_subway_stations AS s ON ST_Contains(n.geom, s.geom);</span> ] but when I try to add the result to the QGIS I get an error message saying "there was an error creating the SQL layer". When I tried the simpler the SQL function
 by selecting only row with a particular name [<span style="color: rgb(200, 38, 19);">SELECT * FROM nyc_neighborhoods WHERE name = 'Soho';</span>]. The SQL statement worked as well as I was able to add the SQL layer on a map. I am using QGIS's DB Manager to
 write SQL statements.</div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
<br>
</div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
I was wondering what I am missing here. </div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
<br>
</div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
Any suggestions or help will be appreciated. FYI. I have installed PostgreSQL 12 with PostGIS 3.</div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
<br>
</div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
Many thanks,</div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
-Tsering</div>
<br>
</div>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature"></div>
</div>
</body>
</html>