Tutorials
Resources
Forum
Reviews
Communities
Interview
Jobs
Projects
Training
Your
Ad
Here
Silverlight Games
|
Mentor
|
Code Converter
|
Articles
|
Code Factory
|
Computer Jokes
|
Members
|
Peer Appraisal
|
IT Companies
|
Bookmarks
|
Polls
|
Revenue Sharing
|
Lobby
|
Gift Shop
|
Prizes & Awards
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
Alwyn
(42)
Nadheera V
(40)
Abhisek Panda
(40)
Last 7 Days
Alwyn
(706)
nishithraj
(512)
Gaurav Arora
(504)
more...
Resources
»
Articles
»
Databases
»
SQL Server Compute and Compute By Clause
Posted Date: 22 Jun 2008
Resource Type:
Articles
Category:
Databases
Author:
Bunty
Member Level:
Diamond
Rating:
Points
: 10
Hi,
The rules regarding the use of the COMPUTE and COMPUTE BY clauses are listed below:
1>The DISTINCT keyword cannot be used with the aggregate functions.
2>All columns referred to in the COMPUTE clause must appear in the SELECT column list.
3>The ORDER BY clause must be used whenever the COMPUTE BY clause is used.
4>The ORDER BY clause can be eliminated only when the COMPUTE clause is used.
5>The columns listed in the COMPUTE BY clause must match the columns used in the ORDER BY clause.
6>More than one COMPUTE clause can be used in the SELECT statement to produce a result with subtotals and a grand total.
7>The different aggregate functions can be used on more than one column with the COMPUTE BY clause.
Responses
No responses found. Be the first to respond and make money from
revenue sharing program
.
Feedbacks
Popular Tags
What are tags ?
Search Tags
Sign In
to add tags.
(No tags found.)
Post Feedback
This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must
Sign In
to post a response.
Next Resource:
Difference B/W Truncate,Delete and Drop Table
Previous Resource:
Differences between User Defined Function and Stored Procedures in SQL Server
Return to Discussion Resource Index
Post New Resource
Category:
Databases
Post resources and
earn money
!
More Resources
Difference B/W Truncate,Delete and Drop Table
Difference between stored procedure and functions in SQL Server
Views
What are magic tables in SQL Server?
ResolveURL Method Part 2
XML Output in SQL Server using FOR XML
dotNet Slackers
About Us
Contact Us
Privacy Policy
Terms Of Use