Skip to main content

Aggregate Functions in SQL SERVER

Aggregate Functions

These functions perform an operation on a set of fields and return a single value. Their use is relatively limited. They can be used in the following situations:

  • The selection list of the SELECT statement
  • A HAVING clause
  • A COMPUTE clause
Function                                                                                     Description

AVG ([ALL| DISTINCT] expression)Returns the average value in the group.
COUNT( [ALL|DISTINCT] expression) Counts the number of items in the group.
COUNT_BIG( [ ALL|DISTINCT] expression) Counts the number of items in the group. the result is returned in the form of bigint number.
GROUPING(Column_Name)Creates an additional column with a value of 1 operator or 0 if it is not the result of a CUBE or ROLLUP operator.
MAX( expression) Returns the maximum value in the expression.
MIN( expression)Returns the minimum value in the expression.
SUM ( expression)returns the sum of the expression's value.
STDEV (expression)Returns the statistical standard deviation for the values in the expression.
VAR (expression) Returns the statistical variance of the values in the expression.

Comments

Popular posts from this blog

Unified Modeling Language- (UML)

Brief Background UML is a language for specifying,visualizing ,documenting and constructing the artifacts of software systems,as well as for business modeling and other non-software systems. UML has been developed by Grady  Booch, James Rumbaugh and Ivar Jacobson. Goals of UML are : To model systems using Object oriented concepts. To establish an explicit coupling to conceptual as well as executable artifacts To address the issues of scale inherent in complex , mission critical systems. To create a modeling language that can be used by humans as well as machines.  Understanding the thirteen diagrams of UML 2.x is an important part of understanding OO development. Although there is  far more to modeling than just the UML  the reality is the UML defines the standard modeling artifacts when it comes to object technology. There are three classifications of UML diagrams: Behavior diagrams . A type of diagram that depicts behavioral features of a ...

Javascript to validate Email Expression

Using  regular expressions  is probably the best way. Here's an example ( live demo ): function validateEmail ( email ) { var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/ i ; return re . test ( email ); } But keep in mind that one should not rely only upon JavaScript validation. JavaScript can easily be disabled. This should be validated on the server side as well.

Local Area Networks LAN

Why use a LAN? The two basic reasons for developing a LAN are information sharing and resource sharing. Information sharing refers to business needs that require users to access the same data files ,exchange emails or search the internet for information. Resource sharing refers to one computer sharing a hardware device (for e.g a printer) or software package with other computers on the network. The main benefit of resource sharing is cost savings, while the main benefit  of information sharing is improved decision making. image courtesy Cray Networks Dedicated Server versus Peer-to-Peer Networks A dedicated server LAN has one computer that acts as the network server. It can connect with almost any other network,handle very large databases and use sophisticated LAN software. Moreover,high -end dedicated server LANs can be interconnected easily to form enterprise wide networks or in some cases replace the host mainframe central computer. Four common types of dedi...