Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)

  • RE: Question: same code, diferent name

    hi,

    How about this for a solution:

    -- my table definition

    create table #Names (code int, [name] varchar(256))

    -- do inserts...

    -- use row number and sort to select top 1 in each code. ...

  • RE: Question: same code, diferent name

    ok, what happens int eh case of a tie?

    Good question, I supose I can select any of the options.

    This code:

    select ,[name], count(name) as cnt

    from mycte

    group by code, [name]

    Returns:

    Code...

  • RE: Question: same code, diferent name

    Ok, sorry,

    the real data looks like:

    Code Name

    75360412 Juan Arias Mejia.

    75360412 ...

Viewing 3 posts - 1 through 3 (of 3 total)