Firstly, if it is relevant, I use MySQL, although I assume that the solution will work through database products. My problem is this:
I have a simple table with one column. There are no restrictions for the column. There are some simple data inside this column, for example
a
a
b
c
d
d
I need to get the number / number of values that appears only once. From the above example, there will be 2 (since only b and c occur once in the column).
Hope it is clear that I do not want the DISTINCT values, but UNIQUE. I did this earlier by creating an extra table with a UNIQUE constraint for the column and just INSERTing to a new table from the old one, processing duplicates accordingly.
I was hoping to find a solution that did not require a temporary table, and somehow it could just be done with an excellent SELECT.
source
share