I'm new to PostGIS. I'm trying to perform a dissolve operation on polygons depending on a particular attribute fields called priFunc and priForm. My SQL query is
SELECT ST_Union(geom) AS new_geom, priFunc, priForm FROM os_greenspace_layer GROUP BY priFunc, priForm
This works fine and my output looks like this
Next, I'd like to remove any features which have a priForm of "Manmade Surface" and omit them completely. So the code now is
SELECT ST_Union(geom) AS new_geom, priFunc, priForm FROM os_greenspace_layer WHERE priForm <> 'Manmade Surface' GROUP BY priFunc, priForm
This gives an output that looks like this
So that works, but it also removes all the features where priForm is NULL and I want to keep those. I've tried using COALESCE to assign a value to the NULL fields but that doesn't seem to work.
How can I do this?