pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rui Carvalho <rui.hmcarvalho@gmail.com>
To: ramasubramanian <ramasubramanian.g@renaissance-it.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Array comparison
Date: Fri, 8 Jan 2010 16:06:44 +0000
Message-ID: <4cb7e1b21001080806o443d6e2bxbccc2f6b820395d3@mail.gmail.com> (raw)
In-Reply-To: <10E4D065260941509531A32BDC0AB647@ramasubramanian>
References: <a222cb861001062021l3f29bdc6kb19a3970089b40ae@mail.gmail.com>
	<10E4D065260941509531A32BDC0AB647@ramasubramanian>

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.g@renaissance-it.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
>
>
>
>

view thread (3+ messages)  latest in thread

Message-ID: <4cb7e1b21001080806o443d6e2bxbccc2f6b820395d3@mail.gmail.com>
Permalink:  ../4cb7e1b21001080806o443d6e2bxbccc2f6b820395d3@mail.gmail.com/
Also on:    postgresql.org/message-id/4cb7e1b21001080806o443d6e2bxbccc2f6b820395d3@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: rui.hmcarvalho@gmail.com, ramasubramanian.g@renaissance-it.com
  Subject: Re: Array comparison
  In-Reply-To: <4cb7e1b21001080806o443d6e2bxbccc2f6b820395d3@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox