Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Cross tabulation (matrix) with sql
I need to make a cross tabulation (matrix table) with the number of
occurences for each set of discrete values of 2 columns, e.g.
Table :
col1 col2 value 1 4 10 1 4 11 1 5 12 2 4 11 2 5 13 2 5 15 2 5 16 2 6 11 Cross tab: 4 5 6 --------------------------- 1 | 2 1 0 2 | 1 3 1
How can I do that with SQL, taking into account that I don't know the number of levels nor the values of these discrete variables ( col1 and col 2). (If that is known it can be done with the decode function)
Cees van Drunen
icg_cees_at_euronet.nl
Received on Sun Sep 20 1998 - 05:15:36 CDT