Subject | RE: Help needed in complex query |
---|---|
Author | kiran.gutta@wipro.com |
Post date | 2006-08-10T08:10:44Z |
Hi,
I have the following tables.
PRINTLOG - contains : USERID, PRINTERIP, PAGES, PAPERSIZE,PAPERTYPE,
COLOR,DUPLEX
PRINTERS - Contains : PRINTERID, PRINTERIP
PRINTERGROUPS - Contains : GROUPID, PRINTERID
USERGRROUPS - Contains : GROUPID, USERID
Using the above information, I need to display a report of Total Pages
printed by each user on each printer for the selected User Group and
Printer Group as shown below.
_______________________________________________
| | | | |
| |_Printer1 |___Printer2__| Total|
| | | | | | | |
|_____________|__A3_|_A4_|_A4_|_B4|_B5_|______|
| | | | | | | | |
| UG1 |__U1__|__4__|__6___8__|_0_|_0__|__18__|
| | | | | | | | |
|______|__U2__|__0__|__3_|_7__|_0_|__1_|__10__|
| | | | | | | | |
| UG2 |__U3__|__1__|__3_|_1__|_5_|__0_|__10__|
| | | | | | | | |
|______|__U4__|__0__|__0_|_0__|_1_|__0_|__1___|
| Total | | | | | | |
|_____________|__5__|_12_|_16_|_6_|_1__|__39__|
Please help me about how to write query /view to get the data in
required format.
Please note that PRINTLOG contains multiple records for a user and
printer. Please let me know if you need more information.
Thanks & Regards,
Kiran
[Non-text portions of this message have been removed]
I have the following tables.
PRINTLOG - contains : USERID, PRINTERIP, PAGES, PAPERSIZE,PAPERTYPE,
COLOR,DUPLEX
PRINTERS - Contains : PRINTERID, PRINTERIP
PRINTERGROUPS - Contains : GROUPID, PRINTERID
USERGRROUPS - Contains : GROUPID, USERID
Using the above information, I need to display a report of Total Pages
printed by each user on each printer for the selected User Group and
Printer Group as shown below.
_______________________________________________
| | | | |
| |_Printer1 |___Printer2__| Total|
| | | | | | | |
|_____________|__A3_|_A4_|_A4_|_B4|_B5_|______|
| | | | | | | | |
| UG1 |__U1__|__4__|__6___8__|_0_|_0__|__18__|
| | | | | | | | |
|______|__U2__|__0__|__3_|_7__|_0_|__1_|__10__|
| | | | | | | | |
| UG2 |__U3__|__1__|__3_|_1__|_5_|__0_|__10__|
| | | | | | | | |
|______|__U4__|__0__|__0_|_0__|_1_|__0_|__1___|
| Total | | | | | | |
|_____________|__5__|_12_|_16_|_6_|_1__|__39__|
Please help me about how to write query /view to get the data in
required format.
Please note that PRINTLOG contains multiple records for a user and
printer. Please let me know if you need more information.
Thanks & Regards,
Kiran
[Non-text portions of this message have been removed]