i'm not sure if this belongs in here or other-software, but here goes.
if i have the following de-normalized table:
how can i run a sql query that outputs the following (note: stored proc is ok, but undesired) (other note: SQL must run on db2, informix AND oracle)
it is mostly a group by id/name but with all the colors and sizes put into a multivalue field and then another field with all the combinations put in from the original table. However, only valid combo's from the previous table are to be entered, i.e. it is not a pure cross product of all the two columns values.
if i have the following de-normalized table:
code:<HR>Code:id name color size ----------------------------- 1 shirt red M 1 shirt blue M 1 shirt red L 1 shirt blue L 1 shirt green XL 2 pants orange M 2 pants blue M 2 pants orange L 2 pants blue L 2 pants orange XL
how can i run a sql query that outputs the following (note: stored proc is ok, but undesired) (other note: SQL must run on db2, informix AND oracle)
code:<HR>Code:id name colors sizes combos --------------------------------------------------- 1 shirt red, blue, green M, L, XL red$M blue$M red$L etc 2 pants orange, blue M, L, XL orange$M, blue$M etc
it is mostly a group by id/name but with all the colors and sizes put into a multivalue field and then another field with all the combinations put in from the original table. However, only valid combo's from the previous table are to be entered, i.e. it is not a pure cross product of all the two columns values.