Comparison Functions - (GREATEST, LEAST)

1) Greatest

This command returns the greatest value in the arguments list. This command can contain one or more arguments.

Example

SELECT GREATEST(EMPLOYEE_ID, MANAGER_ID, DEPARTMENT_ID, SALARY, COMMISSION_PCT) FROM EMPLOYEES;

2) Least

This command returns the least value in the arguments list. This command can contain one or more arguments.

Example

SELECT LEAST(EMPLOYEE_ID, MANAGER_ID, DEPARTMENT_ID, SALARY,COMMISSION_PCT) FROM EMPLOYEES;




No comments:

Post a Comment