• Adelphi (7/23/2012)


    Hi All,

    I have a table that holds the following data:

    ProjectsCustomersUpdatedByNewValueUpdatedOn

    Project 1Customer AUser 1£1,142.0005/01/2012 10:27

    Project 1Customer AUser 1£1,839.0005/01/2012 10:59

    Porject 2Customer BUser 5£121,995.0024/05/2012 09:26

    Project 3Customer CUser 3£20,332.0026/06/2012 09:57

    Project 4Customer DUser 2£18,191.0014/05/2012 13:40

    Project 4Customer DUser 1£46,906.0018/05/2012 13:09

    Project 4Customer DUser 3£58,309.0018/06/2012 13:39

    Project 4Customer DUser 1£76,500.0019/06/2012 15:44

    Project 4Customer DUser 1£88,112.0003/07/2012 14:14

    I will need the results to list only one line for project and customer based on the latest modified date (UpdatedOn) regardless of user details but required too. So the results required:

    ProjectsCustomersUpdatedByNewValueUpdatedOn

    Project 1Customer AUser 1£1,839.0005/01/2012 10:59

    Porject 2Customer BUser 5£121,995.0024/05/2012 09:26

    Project 3Customer CUser 3£20,332.0026/06/2012 09:57

    Project 4Customer DUser 1£88,112.0003/07/2012 14:14

    Your help is highly appreciated and thanks in advance 🙂

    Looks to me like a simple CTE and row_number() function. How about taking this hint and seeing what you can do with it to solve your problem.