Oracle SQL Query rewrite: Make columns suppressed using RTRIM function or ‘+0’

Make columns suppressed using RTRIM function or ‘+0’

If we want to make specific table as leading table, then we can use suppressing on the join columns of the table.

This is an article of Oracle SQL Query rewrite serials.

Take this sql for example:

SELECT sum(salary)
FROM   emp, salary, dept
WHERE  emp.emp_id  = salary.emp_id 
AND    emp.dept_no = dept.dept_no
AND    dept.location = 'SEOUL' ;

SQL will be translated into:(salary table is leading table)

SELECT SUM(salary)
FROM   emp,
       salary,
       dept
WHERE  emp.emp_id = salary.emp_id + 0
       AND emp.dept_no = dept.dept_no
       AND dept.location = 'SEOUL' 

Download this demo: C# version