Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Sequences and group by
klaus1 <klaus.schu_at_gmail.com> wrote:
> hi!
>
> I try to use a select statement whit an myseq.nextval, but I need an
> group by at the end of the select.
>
> select myseq.nextval, a, b, c from table
> groupby a, b, c;
>
select myseq.nextval, a, b, c from (select distinct a, b, c from table);
Or to preserve the (rather silly, in this context) group by:
select myseq.nextval, a, b, c from (
select a, b, c from table group by a, b, c );
Xho
-- -------------------- http://NewsReader.Com/ -------------------- Usenet Newsgroup Service $9.95/Month 30GBReceived on Tue Apr 24 2007 - 10:48:44 CDT