Skip to main content

I have a table with three attributes: NAME, LOCATION, and AREA. I want to get the row with the largest area, for each name. In Oracle, I can do so with this query:

 

select
    name,
    location,
    area
from (
    select
        name,
        location,
        area,
        max(area) over (partition by name) as max_area
    from mytable
)
where area = max_area

 

I could put this into a SQLExecutor, but I'd like to be able to do this even if my data source isn't Oracle.

 

 

Can I accomplish this using FME transformers instead?

The easiest way to do this:

Use Sorter to sort on attributes NAME and AREA(descending).

Use Sampler to sample the first record, group by NAME.


The easiest way to do this:

Use Sorter to sort on attributes NAME and AREA(descending).

Use Sampler to sample the first record, group by NAME.

Thanks, that worked like a charm


I agree with with @erik_jan, but an alternative solution more in tune with the orgininal question could be to use the InlineQuerier.


Reply