Hello ,
I have a table say "Coffee_Mapping" , and it has the foll 2 columns apart from others:
C_Bean_Id,
Coffee_Type
I have 4 Types of Coffee : Cappuchino , Espresso , Mocha and Boring.
There are some beans that can be used for all types of coffee, and some beans that can be used only for Mocha and some only for boring and Espresso , etc
Now i want a report like this (i really dont know how to portray a simple table in this posting : would you please copy paste this into a small file, call it whatever.html and then open it to see the desired o/p? ):
<html>
<body>
<div>
<table border=1>
<tr>
<td>
<p>C_Bean_Id</p>
</td>
<td>
<p>Cappuchino</p>
</td>
<td>
<p>Espresso</p>
</td>
<td>
<p>Mocha</p>
</td>
<td>
<p>Boring</p>
</td>
</tr>
<tr>
<td>
<p>1</p>
</td>
<td>
<p>X</p>
</td>
<td>
<p>X</p>
</td>
<td>
<p>X</p>
</td>
<td>
<p>X</p>
</td>
</tr>
<tr>
<td>
<p>2</p>
</td>
<td>
<p><![if !supportEmptyParas]> <![endif]><o
></o
></p>
</td>
<td>
<p><![if !supportEmptyParas]> <![endif]><o
></o
></p>
</td>
<td>
<p>X</p>
</td>
<td>
<p><![if !supportEmptyParas]> <![endif]><o
></o
></p>
</td>
</tr>
<tr>
<td>
<p>3</p>
</td>
<td>
<p><![if !supportEmptyParas]> <![endif]><o
></o
></p>
</td>
<td>
<p>X</p>
</td>
<td>
<p><![if !supportEmptyParas]> <![endif]><o
></o
></p>
</td>
<td>
<p>X</p>
</td>
</tr>
</table>
</div>
</body>
</html>
Note here that in the original case , the types of coffee are nearly 100 :- but they are a standard set. Apart from using a decode, is there any easy way to get this result using a single query? I am wary of using a 100 decodes to get this data in to a 100 columns. I am sure that this is a common requirement in the business world and Oracle must have a trick up its sleeve for this. I am yet ignorant of it.
Thanks !
Regards,
S. Jayaram Uparna .

I have a table say "Coffee_Mapping" , and it has the foll 2 columns apart from others:
C_Bean_Id,
Coffee_Type
I have 4 Types of Coffee : Cappuchino , Espresso , Mocha and Boring.
There are some beans that can be used for all types of coffee, and some beans that can be used only for Mocha and some only for boring and Espresso , etc
Now i want a report like this (i really dont know how to portray a simple table in this posting : would you please copy paste this into a small file, call it whatever.html and then open it to see the desired o/p? ):
<html>
<body>
<div>
<table border=1>
<tr>
<td>
<p>C_Bean_Id</p>
</td>
<td>
<p>Cappuchino</p>
</td>
<td>
<p>Espresso</p>
</td>
<td>
<p>Mocha</p>
</td>
<td>
<p>Boring</p>
</td>
</tr>
<tr>
<td>
<p>1</p>
</td>
<td>
<p>X</p>
</td>
<td>
<p>X</p>
</td>
<td>
<p>X</p>
</td>
<td>
<p>X</p>
</td>
</tr>
<tr>
<td>
<p>2</p>
</td>
<td>
<p><![if !supportEmptyParas]> <![endif]><o
</td>
<td>
<p><![if !supportEmptyParas]> <![endif]><o
</td>
<td>
<p>X</p>
</td>
<td>
<p><![if !supportEmptyParas]> <![endif]><o
</td>
</tr>
<tr>
<td>
<p>3</p>
</td>
<td>
<p><![if !supportEmptyParas]> <![endif]><o
</td>
<td>
<p>X</p>
</td>
<td>
<p><![if !supportEmptyParas]> <![endif]><o
</td>
<td>
<p>X</p>
</td>
</tr>
</table>
</div>
</body>
</html>
Note here that in the original case , the types of coffee are nearly 100 :- but they are a standard set. Apart from using a decode, is there any easy way to get this result using a single query? I am wary of using a 100 decodes to get this data in to a 100 columns. I am sure that this is a common requirement in the business world and Oracle must have a trick up its sleeve for this. I am yet ignorant of it.
Thanks !
Regards,
S. Jayaram Uparna .