• RedBirdOBX (10/4/2013)


    This should be simple but I' having a hard time wrapping my head around this one late on a friday afternoon.

    I have a table containing people and except for one or two fields, the entire record could be a duplicate and should be treated as so. For example:

    FirstName, LastName, Address, City, State, SSN, SomeNumber

    ***************************************************

    John, Doe, 123 Street, Atlanta, GA, 3000, 123456789, 001

    John, Doe, 123 Street, Atlanta, GA, 3000, 123456789, 004

    John, Doe, 123 Street, Atlanta, GA, 3000, 123456789, 007

    How can I write a select statement to just get the most recently created record like:

    John, Doe, 123 Street, Atlanta, GA, 3000, 123456789, 007

    ???

    Is the SSN encrypted in real life?

    --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)