steamPunk wrote:it just returns the first row of the table
Right. I wonder how I managed to score reasonably well for my database module in university :o
Installer wrote:This doesn't seem ideal, but it should work:
The problem is that you are selecting all the rows for which my_col does not have a value. I suppose that will either return the empty set, or maybe also those rows in which my_col is NULL.
However, that is easily fixed:
SELECT * FROM pl WHERE PL_ID_SITE NOT IN (SELECT PL_ID_SITE FROM p1 GROUP BY PL_ID_SITE HAVING COUNT(PL_ID_SITE) = 1)
There should be an even better solution though 🙁