• with SCC_CTE(vend_i, dept, tot_wgt)

    as (select 1, 1, 75 union all

    select 2, 2, 40 union all

    select 3, 4, 50 union all

    select 3, 5, 80)

    select vend_i, dept from

    (select ROW_NUMBER() over (Partition by vend_i order by dept desc) as theRank, vend_i, dept

    from SCC_CTE) as a

    where theRank = 1

    ---------------------------------------------------------

    It takes a minimal capacity for rational thought to see that the corporate 'free press' is a structurally irrational and biased, and extremely violent, system of elite propaganda.
    David Edwards - Media lens[/url]

    Society has varying and conflicting interests; what is called objectivity is the disguise of one of these interests - that of neutrality. But neutrality is a fiction in an unneutral world. There are victims, there are executioners, and there are bystanders... and the 'objectivity' of the bystander calls for inaction while other heads fall.
    Howard Zinn