Search Postgresql Archives

Using contains operator on arrays that have duplicate elements: feedback request.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Greetings,
I've been trying to use contains operator on an array such as {3,4,9,4,5}
My problem is, I'd like to get rows that has two 4s in them, and contains operator seems to work separately for each member of the right operand. Therefore

select  '{3,4,9,4,5}'::int[] @> '{4,4,4}'

returns true. I'm trying to implement the semantics of the operation so that the set {4,4,4} is a single parameter to a subset query, which should return false in the case above.

Is there any way I can force the contains operation to consider cardinality of unique members of the set ? Arrays look like to simplest way of performing set operations on a group of values, but is there anything else that can be an alternative to them?

Best regards
Seref




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux