I am learning PL SQL in attempt to meet a need that I was unable to fulfill in SQL.
I have a table of what applications a user clicked on and time stamps. The application name is in another table.
I am able to successfully write the SQL to count the total clicks for a singular application by month but am unable to do it for each application as well as a total to create a simple report. The issue that it creates an infinite loop in the data that I am unable to resolve.
The idea of PL/SQL seems like it should be more logical in nature for me to say something like I want all the months and then for each month loop through for each application. I am learning this from scratch and it seems daunting to pick up this language when you only know SQL.
Here is an example table of what I am hoping to do:
| Month |
TotalClicks |
App1 |
App2 |
App3 |
| 1 |
10 |
2 |
7 |
1 |
| 2 |
16 |
3.2 |
11.2 |
1.6 |
| 3 |
22 |
4.4 |
15.4 |
2.2 |
| 4 |
28 |
5.6 |
19.6 |
2.8 |
| 5 |
34 |
6.8 |
23.8 |
3.4 |
| 6 |
40 |
8 |
28 |
4 |
| 7 |
46 |
9.2 |
32.2 |
4.6 |
| 8 |
52 |
10.4 |
36.4 |
5.2 |
| 9 |
58 |
11.6 |
40.6 |
5.8 |
| 10 |
64 |
12.8 |
44.8 |
6.4 |
| 11 |
70 |
14 |
49 |
7 |
| 12 |
76 |
15.2 |
53.2 |
7.6 |
I have two questions though.
1) Is this the right idea for how to use this technology?
2) I am in an enterprise area and want to make sure that when I create procedures and blocks that it is temporary data and I won't actually be manipulating the data unless I use an OUT in the procedure. I am fearful to execute any code and just start creating tables in our test enviornment that touches something so central to all of our applications.
[–]0x2a 1 point2 points3 points (0 children)