Re: Array comparison

From: Rui Carvalho <rui(dot)hmcarvalho(at)gmail(dot)com>
To: ramasubramanian <ramasubramanian(dot)g(at)renaissance-it(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Array comparison
Date: 2010-01-08 16:06:44
Message-ID: 4cb7e1b21001080806o443d6e2bxbccc2f6b820395d3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi

well it's pretty simple

if you want to see if there are elements in common then instead of "any" use
"&&"
if you want to see if they are equal just use " = " that will five you true
or false

you can check array functions in here
http://www.postgresql.org/docs/8.2/static/functions-array.html

On Fri, Jan 8, 2010 at 5:00 AM, ramasubramanian <
ramasubramanian(dot)g(at)renaissance-it(dot)com> wrote:

> Hi all,
> I want to compare the two arrys in sql, The below example is wrong.
> But i want to know how to do that in postgres 8.2.5
>
> SELECT 'x' WHERE string_to_array('the,quick,ram,fox', ',') any
> (string_to_array('the,quick,lazy ,fox', ','))
> Regards,
> Ram
>
>
>
>

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Merlin Moncure 2010-01-08 16:36:04 Re: Array comparison
Previous Message Kevin Grittner 2010-01-08 14:11:19 Re: Massive table (500M rows) update nightmare