pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mauro Bertoli <bertolima@yahoo.it>
To: pgsql-sql@postgresql.org
Subject: Get max value from an comma separated string
Date: Mon, 29 May 2006 13:22:38 +0200 (CEST)
Message-ID: <20060529112238.61079.qmail@web27009.mail.ukl.yahoo.com> (raw)

Hi, I've a field that contain values-comma-separated
like
A) 1;2;3;;5  -- ;2;;4;5
but also
B) 12;34;18
how I can get the max value?
For A I tried:
SELECT max(array_upper(string_to_array(answer,';'),1))
FROM values;
and work fine, but for B case I don't find a solution
like
SELECT max(string_to_array(answer,';')) FROM values;

Any ideas?
Thanks for any hint

Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 



view thread (3+ messages)  latest in thread

Message-ID: <20060529112238.61079.qmail@web27009.mail.ukl.yahoo.com>
Permalink:  ../20060529112238.61079.qmail@web27009.mail.ukl.yahoo.com/
Also on:    postgresql.org/message-id/20060529112238.61079.qmail@web27009.mail.ukl.yahoo.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-sql@postgresql.org
  Cc: bertolima@yahoo.it
  Subject: Re: Get max value from an comma separated string
  In-Reply-To: <20060529112238.61079.qmail@web27009.mail.ukl.yahoo.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