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.  ("David Johnston" <polobo@yahoo.com>)
Список 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 по дате отправления:

Предыдущее
От: Michael Trausch
Дата:
Сообщение: Fwd: Re: Interval "1 month" is equals to interval "30 days" - WHY?
Следующее
От: "David Johnston"
Дата:
Сообщение: Re: Using contains operator on arrays that have duplicate elements: feedback request.