SQL Language (MOSC)

MOSC Banner

convert data from vertical to horziontal

edited Sep 19, 2019 5:02AM in SQL Language (MOSC) 3 commentsAnswered

import_no   inventory_id   val

1                      1                 300

1                      2                 400

1                      3                 800

1                      4                 750

2                      2                 680

2                      5                 700

3                      4                 100

i need the output

import_no     item1      item2      item3         item4      item5   total

1                   300         400        800             750        0           2250

2                   0             680        0                 0            700       1340

3                   0             0            100             0            0            100

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