MySQL Forums
Forum List  »  Newbie

Query pages printed by percentage of total?
Posted by: info
Date: April 06, 2006 11:48AM

Hello,

I'm very new to MySQL and have a query I'm trying to achieve, if anyone can point me in the right direction, I would greatly appreciate it. I have a table created to store print job logs from a print server:

Table = printLogs

logNum mediumint(8)
logDateTime datetime
docNum tinyint(3)
docName varchar(200)
owner varchar(25)
printerName varchar(25)
printerPort varchar(50)
sizeInBytes varchar(50)
pagesPrinted smallint(10)

What I'm trying to do is find a query that, based on a 'printerName', will display 'owner' and percentage derived from the total number of pages printed to that 'printerName' for a given date range.

Something like this:

+--------+--------------------------+
| owner | Percentage of total jobs |
+--------+--------------------------+
| Mary | 50% |
| John | 30% |
| Kim | 10% |
| Sue | 10% |
+--------+--------------------------+

Each row of the table is a different print job and can be one of about 20 different owners who have printed any number of pages to any of 10 printers. The main reason for the query is to be to determine which group/owner uses each printer the most.

Thanks for ANY suggestions,

-Mike

Options: ReplyQuote


Subject
Written By
Posted
Query pages printed by percentage of total?
April 06, 2006 11:48AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.