Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Select statement question
SELECT Id, Site, max(Equipment) as Equipment FROM table1 group by Id, Site
tony1979_at_hotmail.com (Tony) wrote in message news:<d458d67.0109190036.141eccf4_at_posting.google.com>...
> > On 18 Sep 2001 02:48:49 -0700, tony1979_at_hotmail.com (Tony) wrote:
> >
> > >SELECT Id, Site, Equipment FROM table1 order by Id asc;
> > >
> > >Should only return row 1 and 3 ( or 2 and 3 ).
> > >
> > >Is this possible?
> >
> > yes. Try select distinct:
> > SELECT DISTINCT Id, Site, Equipment FROM table1 order by Id asc;
> >
> > Bye,
> > Ralf
>
> What if I need Id and Site to be unique, but not Equipment. Is this
> possible? ( The select statement must be pretty fast ).
>
> Kind regards,
>
> Tony Lee, UK
Received on Thu Sep 20 2001 - 09:02:50 CDT