Skip site navigation (1) Skip section navigation (2)

Array Contained By Array Question

From: "Arthur M(dot) Kang" <arthurmkang(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Array Contained By Array Question
Date: 2011-06-10 16:00:23
Message-ID: 4DF23F97.2040109@gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
How can I search a multidimensional array for an EXACT "subarray" match?

The following produces true when I want it to produce false.  Obviously, 
I would only want it to produce true for ARRAY[1,2], ARRAY[3,4], or 
ARRAY[5,6].

SELECT ARRAY[ARRAY[1,2], ARRAY[3,4], ARRAY[5,6]] @> ARRAY[ARRAY[1,6]];

Any help is greatly appreciated.

Thanks.

Arthur


Responses

pgsql-novice by date

Next:From: Merlin MoncureDate: 2011-06-10 17:31:07
Subject: Re: Array Contained By Array Question
Previous:From: Charles N. CharottiDate: 2011-06-10 13:24:35
Subject: Re: Indenting PLPGSQL code

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group