The || operator in Oracle SQL / PLSQL can be used to concatenate multiple strings to form a single string. Syntax for the using the || operator in Oracle SQL / PLSQL is: SELECT string_1 || string_2 || string_3 || . . . || string_N FROM table_name; string_1, strring_2 . . string_N are the strings […]
sql
CUBE in Oracle SQL – PLSQL
The CUBE in Oracle SQL / PLSQL is an extension for the GROUP BY clause. Syntax for CUBE in Oracle SQL / PLSQL is: SELECT column(s), AGGREGATE_FUNCTION(s), FROM table_name GROUP BY CUBE column(s) [ORDER BY column(s)]; Example: Using CUBE in Oracle SQL / PLSQL Query Suppose we have a table named ‘employee’ as shown below: […]
PARTITION BY Keyword in Oracle SQL – PLSQL
In simple terms the PARTITION BY keyword in Oracle SQL / PLSQL is used to partition or segregate the records based on groups Syntax for the PARTITION BY keyword in Oracle SQL / PLSQL is: SELECT columns ,aggregate_function OVER (PARTITION BY column(s)) FROM table_name; Example 1: Using PARTITION BY keyword Suppose we have a table […]
ROWNUM Pseudo Column in Oracle SQL – PLSQL
The ROWNUM is a pseudo column in Oracle SQL / PLSQL which returns a row’s position in the fetched result set. ROWNUM is evaluated AFTER records are SELECTED from the data-base and BEFORE execution of the ORDER BY clause. Syntax for the ROWNUM function in Oracle SQL / PLSQL is: SELECT column(s) FROM table_name WHERE […]
INDEX in Oracle SQL – PLSQL
In Oracle SQL /PLSQL an INDEX is basically a performance tuning method which allows us to retrieve or fetch the desired records faster. An INDEX will create an entry for each value that is stored in the indexed columns. Syntax for creating an INDEX in Oracle SQL / PLSQL is: CREATE [UNIQUE] INDEX index_name ON […]