Re: Collect function

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Wed, 16 Sep 2009 21:36:33 +0200
Message-ID: <4ab13e44$0$404$426a74cc_at_news.free.fr>


"Dan Blum" <tool_at_panix.com> a écrit dans le message de news: h8rdtj$e66$1_at_reader1.panix.com...
| Sashi <smalladi_at_gmail.com> wrote:
| > HI all, I'm trying to use the collect() function (mentioned in my
| > earlier post in this ng) but it, well, collects all values. Is there
| > any way of avoiding duplicates?
| > What I'm trying to do is this:
|
| > select collect(a1), a2, a3, a4
| > from A
| > group by a2, a3, a4.
|
| select collect(distinct a1)... should work.
|
| --
| _______________________________________________________________________
| Dan Blum tool_at_panix.com
| "I wouldn't have believed it myself if I hadn't just made it up."

It does.

SQL> select collect(val) from t;
COLLECT(VAL)



SYSTPYmvHKMavRw27KIB3yptjFg==(1, 2, 1, 1)

1 row selected.

SQL> select collect(distinct val) from t; COLLECT(DISTINCTVAL)



SYSTPYmvHKMavRw27KIB3yptjFg==(1, 2)

1 row selected.

Regards
Michel Received on Wed Sep 16 2009 - 14:36:33 CDT

Original text of this message