/*Group by Functions GROUP or AGGREGATE Functions Group or Aggregate functions process similary group of rows and returns one value 1.MAX() 2.MIN() 3.SUM() 4.AVG() 5.COUNT() 6.COUNT(*) 7.count(1) 1.MAX() It returns maximum value. Syntax: MAX(colname) Eg: */ SELECT MAX(SAL) FROM EMP; SELECT MAX(HIREDATE) FROM EMP; --It will give us the most recent record which has the recent date. select hiredate from emp order by hiredate desc; SELECT MAX(ENAME) FROM EMP; --WARD select ename from emp order by ename desc; select max(sal) from emp;--5000 select max(hiredate) from emp;--12-JAN-83 select max(ename) from emp;--WARD select max(empno) from emp;--7934 select max(job) from emp;--SALESMAN select max(comm) from emp;--1540 select max(deptno) from emp;--30 select comm from emp; /* MI...
Posts
Showing posts with the label Group by Functions