1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] Get most recent using datetime (sql)

Discussão em 'Outras Linguagens' iniciado por Stack, Outubro 3, 2024 às 18:53.

  1. Stack

    Stack Membro Participativo

    I have following table -

    | Table | Status | Code | Timestamp
    | -------- | --------- | ------ | ---------------
    | Budget | Success | access | 03-02-2024T08:04:23.19Z
    | Property | Failed | access | 03-02-2024T08:04:23.19Z
    | Transfer | Success | access | 03-02-2024T08:04:23.19Z
    | Property | Success | access | 03-02-2024T08:04:23.19Z
    | Load | Success | access | 03-02-2024T00:07:02.54Z
    | Property | Failed | access | 03-02-2024T00:07:02.54Z
    | Transfer | Success | uprow | 03-02-2024T00:07:02.54Z
    | Load | Success | uprow | 01-02-2024T18:17:54.42Z
    | Property | Failed | uprow | 01-02-2024T18:17:54.42Z
    | Transfer | Success | uprow | 01-02-2024T18:17:54.42Z


    I want recent timestamp for each of the table, where code is 'access'. This is independent of the status. Please suggest a sql query.

    | Table | Status | Code | Timestamp
    | -------- | --------- | ------ | ---------------
    | Budget | Success | access | 03-02-2024T08:04:23.19Z
    | Property | Failed | access | 03-02-2024T08:04:23.19Z
    | Transfer | Success | access | 03-02-2024T08:04:23.19Z
    | Load | Success | access | 03-02-2024T00:07:02.54Z

    Continue reading...

Compartilhe esta Página