HTML Tutorials |
|
XML Tutorials |
|
Browser Scripting |
|
Server Scripting |
|
.NET (dotnet) |
|
Multimedia |
|
Web Building |
|
Java Tutorials |
|
Programming Langauges |
|
Soft Skills |
|
Database Tutorials |
|
Operating System |
|
Software Testing |
|
SAP Module |
|
Networking Programming |
|
Microsoft Office |
|
Accounting |
|
|
SQL Functions
|
Eine Funktion ist eine spezielle Art Befehl, das einen einzelnen Wert zur�ckbringen.
|
Skalarfunktionen
|
Unterschiedliche Kategorien der Skalarfunktion sind: -
- Aggregate functions
It operate against a collection of values, but return a single Value.
- Scalar functions
It operate against a single value, and return a single value based on the input value.Functions like CURRENT_TIME for example, do not require any arguments.
|
SELECT function(column) FROM table
|
Aggregate Functions
|
It return a single value based upon a set of other values. If used among many other expressions in the item list of a SELECT statement, the SELECT must have a GROUP BY clause.
No GROUP BY clause is required if the aggregate function is the only value retrieved by the SELECT statement
|
Supported aggregate functions are:
|
Function
|
Usage
|
AVG(expression)
|
Computes the average value of a column by the expression
|
COUNT(expression)
|
Counts the rows defined by the expression
|
COUNT(*) |
Counts all rows in the specified table or view
|
MIN(expression)
|
Finds the minimum value in a column by the
expression
|
MAX(expression)
|
Finds the maximum value in a column by the
expression
|
SUM(expression)
|
Computes the sum of column values by the expression
|
SELECT COUNT(*) FROM customers;
|
Scalar Functions
|
Different categories of Scalar Function are:-
- Built-in Function
- Date & Time Function
- Numeric Function
- String Function
|
Some Scalar Functions are:-
|
Function |
Description |
UCASE(c) |
Converts a field to upper case |
LCASE(c) |
Converts a field to lower case |
MID(c,start[,end]) |
Extract characters from a text field |
LEN(c) |
Returns the length of a text field |
INSTR(c,char) |
Returns the numeric position of a named
character within a text field |
LEFT(c,number_of_char) |
Return the left part of a text field
requested |
RIGHT(c,number_of_char) |
Return the right part of a text field
requested |
ROUND(c,decimals) |
Rounds a numeric field to the number of
decimals specified |
MOD(x,y) |
Returns the remainder of a division
operation |
NOW() |
Returns the current system date |
FORMAT(c,format) |
Changes the way a field is displayed |
DATEDIFF(d,date1,date2) |
Used to perform date calculations |
Keywords sql date function, sql max function, sql convert function,
sql replace function, sql trim function, sql sum function, sql string function,
sql round function, oracle sql function, sql left function
|
|
HTML Quizes |
|
XML Quizes |
|
Browser Scripting Quizes |
|
Server Scripting Quizes |
|
.NET (dotnet) Quizes |
|
Multimedia Quizes |
|
Web Building Quizes |
|
Java Quizes |
|
Programming Langauges Quizes |
|
Soft Skills Quizes |
|
Database Quizes |
|
Operating System Quizes |
|
Software Testing Quizes |
|
SAP Module Quizes |
|
Networking Programming Quizes |
|
Microsoft Office Quizes |
|
Accounting Quizes |
|
|