Difference between revisions of "TYPES"

From rbachwiki
Jump to navigation Jump to search
(Created page with "==MIN()Returns the smallest Value== ==MAX() Returns the largest Value == ==SUM() Returns the sum of values == ==AVG() Returns the Average of Values == ==COUNT() Returns th...")
 
Line 1: Line 1:
==MIN()Returns the smallest Value==
==MIN()Returns the smallest Value==
SELECT COUNT(*), SUM(TOTAL_AMOUNT), MIN(TOTAL_AMOUNT) from sales;
'''Returns the count in one column, the sum of the total_amount column and Min amount'''


==MAX() Returns the largest Value ==
==MAX() Returns the largest Value ==


==SUM() Returns the sum of values ==
==SUM() Returns the sum of values ==
SELECT COUNT(*), SUM(TOTAL_AMOUNT) from sales;
'''Returns the count in one column and the sum of the total_amount column'''


==AVG() Returns the Average of Values ==
==AVG() Returns the Average of Values ==


==COUNT() Returns the number or rows ==
==COUNT() Returns the number or rows ==
SELECT COUNT(*) FROM SALES
''' Returns the record count'''


==FIRST() Returns the first value of the group==
==FIRST() Returns the first value of the group==


==LAST() Returns the last value of the group==
==LAST() Returns the last value of the group==

Revision as of 23:54, 31 October 2017

MIN()Returns the smallest Value

SELECT COUNT(*), SUM(TOTAL_AMOUNT), MIN(TOTAL_AMOUNT) from sales;

Returns the count in one column, the sum of the total_amount column and Min amount

MAX() Returns the largest Value

SUM() Returns the sum of values

SELECT COUNT(*), SUM(TOTAL_AMOUNT) from sales;

Returns the count in one column and the sum of the total_amount column

AVG() Returns the Average of Values

COUNT() Returns the number or rows

SELECT COUNT(*) FROM SALES

Returns the record count

FIRST() Returns the first value of the group

LAST() Returns the last value of the group