What is non-equi join in Oracle sql? Plsql Interview question for fresher,intermediate and experienced.
Non-equi join:
It is the type of inner join which combines the rows from two tables based on the condition. Comparison between the columns of the tables is not based on the equality operator (i.e. not equal to) or not equal sign operator like <,>,<= and >=. Matching data of the tables are based on an inequality operator rather than equality operator. It is allowing to filter the data of the tables on the basis of range conditions. It is based on the relative values which is satisfied by the tables. It is suitable to retrieve the data based on the range conditions.
It is applicable when one or more columns are using an inequality comparison. It will filter the data on the basis of range. It is the type of inner join. It is used to check the duplicate values. It is used to examine that one value in the one table will fall into the another table.
SYNTAX:
In the above syntax, we are joining table1 and table2 because the values in table1.column_name are greater than or equals to the values in table2.column_name. It will return all the rows where this condition is true.
select * from emp JOIN dept ON emp.deptno<dept.deptno
where emp.sal>3000;
Usage:
It will filter the data on the basis of range. It is used to filter the emp data based on the range of dept.
It is used for finding the gaps in the inventory management data when there are no matching orders between the table's customer orders and inventory products.
It is used to analyze the trends over the time. It is used to analyze the changes in the product prices over time for the product and customer orders tables.
It is used for combining the multiple conditions in the single join.
Checking for the duplicate data between the tables.
Calculating the total data.
Comments
Post a Comment