Select from list of values received from a subquery, possibly null
A (simplified version of my) query looks like this:
SELECT id
FROM table
WHERE column1
IN
(
SELECT column1
FROM table
GROUP BY column1
HAVING COUNT(*) > 1
)
This selects a list of id's where column1 has multiply occuring values (in
other words, these are not unique). This works as expected with one
exception: if the value NULL occurs multiple times (which is possible), no
ids are selected. What would be the correct way to select ids of columns
in case NULL turns out to be non unique?
No comments:
Post a Comment