Using SSIS, How do I find the cities with the largest population?

后端 未结 2 615
野的像风
野的像风 2020-12-12 01:22

I have a dataflow task with information that looks something like this:

Province | City    | Population
-------------------------------
Ontario  | Toronto |          


        
2条回答
  •  感动是毒
    2020-12-12 02:11

    Instead of using the Aggregate transformation, could you use a SQL query instead?

    SELECT
        p.province,
        p.city,
        p.[population]
    FROM
        temp_pop P
        JOIN ( SELECT
                province,
                [population] = MAX([POPULATION])
               FROM
                temp_pop
               GROUP BY
                province
             ) AS M ON p.province = M.province AND
                       p.[population] = M.[population]
    

提交回复
热议问题