Aggregate Functions
MySQL last
MySQL last function is used to return the last value of the selected column. Syntax: SELECT column_name FROM table_name ORDER BY column_name DESC LIMIT 1; MySQL last function example Consider a…
MySQL first
The MySQL first function is used to return the first value of the selected column. Here, we use limit clause to select first record or…
MySQL max()
The MySQL max() function is used to return the maximum value of an expression. It is used when you need to get the maximum value…
MySQL min()
The MySQL min() function is used to return the minimum value from the table. Syntax: SELECT MIN (aggregate_expression) FROM tables [WHERE conditions]; Parameter explanation aggregate_expression: It specifies the column…
MySQL avg()
The MySQL avg() function is used to return the average value of an expression. Syntax: SELECT AVG(aggregate_expression) FROM tables [WHERE conditions]; Parameter explanation aggregate_expression: It specifies the column…
MySQL sum()
The MySQL sum() function is used to return the total summed value of an expression. Syntax: SELECT SUM(aggregate_expression) FROM tables [WHERE conditions]; Parameter explanation aggregate_expression: It specifies the…
MySQL count()
The MySQL count() function is used to return the count of an expression. It is used when you need to count some records of your…