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

Поиск
Список
Период
Сортировка
От Seref Arikan
Тема Using contains operator on arrays that have duplicate elements: feedback request.
Дата
Msg-id CA+4Thdrj49+G30xwbK3zZddDvR0syRuW+g0ckZT+-gCo=ecM0Q@mail.gmail.com
обсуждение исходный текст
Ответы Re: Using contains operator on arrays that have duplicate elements: feedback request.
Список pgsql-general
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



В списке pgsql-general по дате отправления: