In a database i have two colums: id
and value
. I want to check how many difrent id
's there is in my result
, how can i do that?
I have tried to think of an solution, but i haven't succeed more that countDifferentId(){// do some magic calculations}
result
looks like this:
[ RowDataPacket {
id: 76561198115203520,
value: 73 },
RowDataPacket {
id: 76561198115029751,
value: 73 }
RowDataPacket {
id: 76561198115702984,
value: 73 },
RowDataPacket {
id: 76561198115203520,
value: 73 } ]
So the result of countDifferentId()
should be 3