Find out what clause a DB Object belongs to?
Sometimes, You may need to find out which clause database objects belongs to, for example, in update statement, whether it is in a SET or Where clause?
update employees set department_ID = 70 where employee_id = 113;
This demo helps you fully take advantage of the general SQL parser to achieve this quickly with the result like this:
department_ID location:set employee_id location:where
Which means department_ID is in set clause while employee_id is in where clause.
Here is another example for delete SQL statement with nested subquery:
DELETE FROM employees e WHERE employee_id = (SELECT employee_sal FROM emp_history WHERE employee_id = e.employee_id);
The result will be like this:
employee_id location:where e.employee_id location:where employee_sal location:resultColumn(select list item) employee_id location:where
Download this demo: Java version, C# demo