Author: Awais Farooq
-
Oracle INNER JOIN
Inner Join is the simplest and most common type of join. It is also known as simple join. It returns all rows from multiple tables where the join condition is met. Syntax Image representation of Inner Join Oracle INNER JOIN Example Let’s take an example to perform Inner Join on two tables “Suppliers” and “Order1”.…
-
Oracle Joins
Join is a query that is used to combine rows from two or more tables, views, or materialized views. It retrieves data from multiple tables and creates a new table. Join Conditions There may be at least one join condition either in the FROM clause or in the WHERE clause for joining two tables. It…
-
Oracle MINUS operator
In Oracle, MINUS operator is used to return all rows in the first SELECT statement that are not returned by the second SELECT statement. Each SELECT statement has a dataset and the MINUS operator returns all documents from the first dataset and then removes all documents from the second dataset. For example Syntax Parameters 1)…
-
Oracle INTERSECT Operator
In Oracle, INTERSECT Operator is used to return the results of 2 or more SELECT statement. It picks the common or intersecting records from compound SELECT queries. Syntax Parameters 1) expression1, expression2, … expression_n: It specifies the columns that you want to retrieve. 2) table1, table2: It specifies the tables that you want to retrieve records from.…
-
Oracle UNION ALL Operator
In Oracle, the UNION ALL operator is used to combine the result sets of 2 or more SELECT statements. It is different from UNION operator in a way that it does not remove duplicate rows between the various SELECT statements. It returns all of the rows. Each SELECT statement within the UNION ALL must have…
-
Oracle UNION Operator
In Oracle, UNION operator is used to combine the result sets of two or more Oracle SELECT statements. It combines the both SELECT statement and removes duplicate rows between them./p> Each SELECT statement within the UNION operator must have the same number of fields in the result sets with similar data types. Syntax Parameters 1)…
-
Oracle HAVING Clause
In Oracle, HAVING Clause is used with GROUP BY Clause to restrict the groups of returned rows where condition is TRUE. Syntax: Parameters: expression1, expression2, … expression_n: It specifies the expressions that are not encapsulated within aggregate function. These expressions must be included in GROUP BY clause. aggregate_function: It specifies the aggregate functions i.e. SUM, COUNT, MIN,…
-
Oracle GROUP BY Clause
In Oracle GROUP BY clause is used with SELECT statement to collect data from multiple records and group the results by one or more columns. Syntax: Parameters: expression1, expression2, … expression_n: It specifies the expressions that are not encapsulated within aggregate function. These expressions must be included in GROUP BY clause. aggregate_function: It specifies the aggregate functions…
-
Oracle ORDER BY Clause
In Oracle, ORDER BY Clause is used to sort or re-arrange the records in the result set. The ORDER BY clause is only used with SELECT statement. Syntax: Parameters: expressions: It specifies columns that you want to retrieve. tables: It specifies the table name from where you want to retrieve records. conditions: It specifies the conditions that must…
-
Oracle FROM Clause
FROM clause is a mandatory clause in SELECT expression. It specifies the tables from which data is to be retrieved. Syntax: Oracle FROM Clause Example: (with one table) Let’s take an example to explain how to use FROM clause to retrieve data from one table. Consider a table “customers”. Customer table: Execute this query: Output:…