## Egon Frerich (egon@frerich.eu):
> Why are there 0 rows? I expect 3 rows:
From your results I guess that sp3 IS NULL on the three rows where
it is not 'j'. You should use the correct comparison predicate for
this case, i.e. IS DISTINCT FROM instead of <>.
https://www.postgresql.org/docs/9.6/static/functions-comparison.html
Regards,
Christoph
--
Spare Space.