Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: sql question - distinct
The result of the following query is what I like to get:
SELECT MAX(BFP_NUMBER), MAX(METER_NUMBER), UNIT_ID
FROM BMA_RENTAL_AGREEMENT_UPPER
GROUP BY UNIT_ID
but I do not need/want to have a group by FUNCTION MAX or any other
group by function
Is this possible? to do it in other way?
Steve Howard wrote:
> soalvajavab1_at_yahoo.com wrote:
> >
> > I want DISTINCT only applies to UNIT_ID but I also have data for
> > BFP_NUMBER, METER_NUMBER in each result rows.
> >
>
> I'm still not clear on what you want. Using Galen's example above, do
> you want to see...
>
> UNIT_ID BFP_NUMBER METER_NUMBER
> 1 10 100
> 11 101
> 2 12 102
>
> ?
>
> Regards,
>
> Steve
Received on Tue Nov 28 2006 - 17:45:46 CST