Oracle PL/SQL Lag Function The Lag function returns values from a previous row in the table. The Lag Function syntax: lag ( exp [, offset [, default] ] ) over ( [ query_partition_clause ] order_by_clause ) Example: Select job_id, start_date, lag...
Oracle PL/SQL Instr Function The Instr function returns the location of a substring in a string. The Instr Function syntax: instr( string1, string2 [, start_position [, n_appearance ] ] ) String1 is the string to search. String2 is the substring to...
Oracle PL/SQL Initcap Function The Initcap function sets the first character in each word to uppercase. The Initcap Function syntax: initcap( string ) Example: select initcap('oracle tutorial code') from dual; Oracle Tutorial Code select initcap('ORACLE TUTORIAL CODE') from dual; Oracle Tutorial...
Oracle PL/SQL Group_ID Function The Group_ID function assigns a number to each group resulting from a GROUP BY clause. For each unique group will return 0. When a duplicated group is found, the group_id function will return a value >0. Example:...
Oracle PL/SQL Greatest Function The Greatest function returns the greatest value in a list of expressions. The Greatest Function syntax: greatest( exp1, exp2, … exp_n ) Example: Select greatest(4, 7, 11, 9) From dual; 11 Select greatest('4', '7', '11', '9') From...