SQL

Home » SQL

Find Max Value in List in Oracle

You can use the greatest() function in Oracle to find the maximum value in the list. Below are its syntax and examples: Syntax greatest(value1, value2, value3, ...) Example-1: The following SQL query will get the maximum value from the comma-separated list: select greatest(5, 29, 99, 89) grt from dual; Output: 99 Example-2: Get the maximum …

Find Max Value in List in Oracle Read More »

What is Any_Value in Oracle?

In Oracle, any_value is a function that you can use to return any value from a table on which you are aggregating a column value. For example, you are summing up the salary on the department number for the EMP table and you want to display one of the employee names from that department. Then, …

What is Any_Value in Oracle? Read More »

How to Get Next Row Value in Oracle?

Use the lead() function to get the next row value in Oracle. Below are its syntax and example: Lead Function Syntax lead(expr, offset, default_value) over (partition_by_clause order_by_clause) For the expr, specify the column name, for offset, specify the row number, and for the default_value, specify the value to show the default value for the last …

How to Get Next Row Value in Oracle? Read More »

Get Remainder in Oracle

To get the remainder in Oracle, you can use the mod() or remainder() functions. Below are the syntax and examples for the same: Mod Function Syntax mod(n2, n1) MOD gives you the remainder when dividing n2 by n1. If n1 is zero, it gives back the value for n2. Get Remainder in Oracle Using Mod …

Get Remainder in Oracle Read More »

Convert a String to Uppercase in Oracle

To convert a string to uppercase, use the upper() function in Oracle. Below are the syntax and examples: UPPER Function Syntax upper(char) UPPER Function Examples The following SQL query converts a string to uppercase using the upper() function: select upper('oracle') from dual; Output: ORACLE Using UPPER Function in PL/SQL Program Below PL/SQL code demonstrates, how …

Convert a String to Uppercase in Oracle Read More »

How do I Substring a String in Oracle?

To substring a string you can use the substr function in Oracle. The SUBSTR functions return a substring of string, starting at character position and lasting substring length characters. The following are the substr function syntax and some examples: Substr Function Syntax substr(char, position, substring_length); The SUBSTR functions return a substring of char, starting at …

How do I Substring a String in Oracle? Read More »