SQL Language (MOSC)

MOSC Banner

get the last record for items

edited Feb 18, 2018 2:01AM in SQL Language (MOSC) 1 commentAnswered ✓

if we have data like

invoice_id      invoice_line_id      item_id     date               value

1                        1                            1          1-1-2017          10

1                         2                            2          1-1-2017          20

2                         1                           1           10-1-2017        12

2                          2                           2           10-1-2017        22

3                         1                            1            20-1-2017       12.5

4                         1                             2          22-1-2027         22.5

we want to get for each item the last value by using the maximum date and data will be like this

invoice_id       item_id           date               value

3                        1                  20-1-2017          12.5

4                         2                 22-1-2017          22.5

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center