Databases| SQL| MySQL| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials:
 

Software Solutions and Services
 

 
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments
 
MySQL Addition 
 

MySQL Addition returns you the sum value of the total counts in a table. The Aggregate function is used to perform the calculation in SQL Query.

 

MySQL Addition

                         

MySQL Addition returns you the sum value of the total counts in a table. The Aggregate function is used to perform the calculation in SQL Query. We make use of Aggregate function with group by and order by.

 Understand with Example

The Tutorial illustrate an example from 'MySQL Addition'. To understand the example we have a table employee in the database. The select order by query is used to sort the records by specific column. In this example we sorts the records of name and salary on the basis of salary column from table 'employee'.

 

 

 

Query

 

select name, salary from employee order by salary;

 

Output

 

+------------------------+--------+
| name                   | salary |
+------------------------+--------+
| Miss.hardeep           | 5000   |
| Mr.komal choudhary     | 5000   |
| Mr.girish tewari       | 5000   |
| Mr.sandeep kumar suman | 6000   |
| Mr.govind              | 6000   |
| Mr.vineet bansal       | 6000   |
| Miss.anusmita          | 6000   |
| Mr.amit raghuvanshi    | 6000   |
| Mr.santosh kashyap     | 7500   |
| Mr.amardeep patel      | 8000   |
| Mr.vikash              | 8500   |
| Mr.vinod kumar         | 8500   |
| Mr.ravi kant           | 10000  |
| Mr.rakesh              | 12000  |
| Mr.noor                | 13500  |
| Mr.deepak mohanty      | 15000  |
| Mr.vimlaksha gautam    | 15000  |
| Mr.suman saurabh       | 17000  |
+------------------------+--------+

 

In this example the sum keyword is used to calculate the salary of employee in a table 'employee'.

Query

 

 select sum(salary) from employee;

 

Output

 

+-------------+
| sum(salary) |
+-------------+
| 160000      |
+-------------+

 

                         

» View all related tutorials
Related Tags: sql mysql c table sed tab if ie record records to ci e use trie pe from m tr spec

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Training Courses
Tell A Friend
Your Friend Name
Website Designing Services
 
Web Designing Packages From $150!
 
Website Designing Company Web Hosting
 
Website Designing Quotation
 
Search Tutorials:

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.