working on Oracle DB, i have the following 'GROUPS' table:
ID NAME LAYER VALUE
1 A L1 100
1 A L2 200
1 A L3 300
1 A L4 400
1 A L5 500
2 B L1 111
2 B L2 222
2 B L3 333
2 B L4 444
2 B L5 555
2 B L6 666
2 B L7 777
**ID** - identifies the group.
**NAME** - group's name.
**LAYER** - a layer in the group ; a group consists of N layers.
**VALUE** - the value of a given layer in a given group.
the data in this table represents 2 elements, distinguishable by ID (1 and 2). each group contains N layers (for group 1, L1-L5 ; for group 2 L1-L7), each layer has a value.
i'm trying to create DB functionality that will pivot dynamic layers data so the each layer will become a column, and it's rows will be it's values for each unique id (1,2) in the table.
ID NAME L1 L2 L3 L4 L5 L6 L7
1 A 100 200 300 400 500
2 B 111 222 333 444 555 666 777
notice that the groups have different numbers of layers.
said functionality can be a view , a function or a stored procedure - anything really, as long as it's being handled by the DB.
Thanks very much For Your Help!
Nir