• To help us help you, rather than posting a picture of the data, please see the first link under "Helpful Links" in my signature line below and post your data as per that article. Otherwise the answer is simply, express a ROW_NUMBER() over the partitions formed by the articulo column in descending order by fecha_hora_transac in a CTE and select only the rows with a ROW_NUMBER() of "1" from that.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)