| | |
Query Needed
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Jul 2006
Posts: 197
Reputation:
Solved Threads: 5
hi
Thanks for your reply
Table structure here
Thanks for your reply
Table structure here
sql Syntax (Toggle Plain Text)
CREATE TABLE IF NOT EXISTS `invoice` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `instance_id` INT(11) NOT NULL DEFAULT '0', `project_id` INT(11) NOT NULL DEFAULT '0', `user_id` INT(11) NOT NULL DEFAULT '0', `instance_category_tasks_master_id` INT(11) NOT NULL DEFAULT '0', `invoice_id` INT(11) NOT NULL DEFAULT '0', `hours` DOUBLE(3,2) NOT NULL DEFAULT '0.00', `DATE` DATE NOT NULL DEFAULT '0000-00-00', `pay_rate` DOUBLE(5,2) NOT NULL DEFAULT '0.00', `bill_rate` DOUBLE(5,2) NOT NULL DEFAULT '0.00', `billable` ENUM('yes','no') NOT NULL DEFAULT 'yes', `created_date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', `created_ipaddress` VARCHAR(15) NOT NULL DEFAULT '', `updated_date` DATE NOT NULL DEFAULT '0000-00-00', `updated_ipaddress` VARCHAR(15) NOT NULL DEFAULT '', `active` CHAR(3) NOT NULL DEFAULT '', `timecard_id` INT(11) NOT NULL, PRIMARY KEY (`id`) )
Last edited by peter_budo; Sep 11th, 2008 at 5:40 am. Reason: Keep It Organized - please use [code] tags
Thanks
VSSP
VSSP
hello vssp...
there is a function called SUM in mysql to calculate total of any numerical column...and if you want to calculate per month,then use limit by 30 days...or created_date < last day of month...
see this link for your reference:
http://www.tizag.com/mysqlTutorial/mysqlsum.php
there is a function called SUM in mysql to calculate total of any numerical column...and if you want to calculate per month,then use limit by 30 days...or created_date < last day of month...
see this link for your reference:
http://www.tizag.com/mysqlTutorial/mysqlsum.php
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
hello see this example will help you:
t1 table having 4 columns like year,month,day,points...
year month day points
2000 01 01 1
2000 01 20 3
2000 01 02 5
2000 02 23 10
then here im calculting total point per month...
here is the query:
it will print:
year month points
2000 01 8
2000 02 15
t1 table having 4 columns like year,month,day,points...
year month day points
2000 01 01 1
2000 01 20 3
2000 01 02 5
2000 02 23 10
then here im calculting total point per month...
here is the query:
mysql Syntax (Toggle Plain Text)
SELECT YEAR, MONTH , sum( points ) AS points FROM t1 GROUP BY YEAR, MONTH
year month points
2000 01 8
2000 02 15
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
![]() |
Similar Threads
- PHP Coder needed to finish website - URGENT (Web Development Job Offers)
- Volunteer C++ programmer needed for (C++)
- URGENT!! - Constructive Criticism needed on www.giftday.co.za (Website Reviews)
- Secure MP3 Downloads ?? Help Needed (PHP)
- Unexpected T_STRING? (PHP)
- file query (C++)
- Query Troubles (ColdFusion)
- Query hell (MySQL)
- Urgent help needed.!!.Please (C)
Other Threads in the MySQL Forum
- Previous Thread: SQL help - flat select
- Next Thread: Database import in Cpanel 11
| Thread Tools | Search this Thread |
Tag cloud for MySQL
1 agplv3 alfresco api artisticlicense aws bizspark breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright court crm data database design developer development distinct dui eliminate email enter enterprise error eudora facebook form foss gnu government gpl greenit groupware hiring hyperic images innerjoins insert ip joebrockmeier join keyword keywords kickfire laptop law legal license licensing linux maintenance managing mariadb matchingcolumns metron microsoft microsoftexchange montywidenius multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opengovernment opensource operand oracle penelope php query referencedesign reorderingcolumns results resultset saas search select sharepoint simpledb sourcecode spotify statement sugarcrm syntax techsupport thunderbird transparency update virtualization






