Here is an example SQL that retrieves data from EMPLOYEE and DEPARTMENT table with the employee’s grade code in the GRADE table. SELECT emp_id,...
Here the following is a simple SQL statement with a CASE expression syntax. SELECT * FROM employee WHERE CASE WHEN emp_salary<...
You may suffer from SQL statements with a slow first execution time due to the long data cache process. The following SQL is simple that retrieves...
We used to use FORCE INDEX hints to enable an index search for a SQL statement if a specific index is not used. It is due to the database SQL...
For some SQL statements that are failed to be tuned by syntax rewrite, hints injection, and all necessary indexes are built, people may think that...
There are some SQL statements with performance problem can be tuned by Hints injection only. Here is an example to show you how to use...
Here the following is a simple SQL statement with a CASE expression syntax. SELECT * FROM EMPLOYEE WHERE CASE when emp_id < 1001000 then 'Old...
There are some SQL statements with performance problem have to be tuned by SQL syntax rewrite and Hints injection, it is a little bit difficult...
The following is an example that shows a SQL statement with an EXISTS subquery. The SQL counts the records from the EMPLOYEE table if the OR...
Here the following is a simple SQL statement with a “< ANY (Subquery)” syntax. SELECT * FROM employee WHERE emp_salary< ANY (SELECT emp_salary...
For SQL statements that are not executed frequently, so that the relevant data is no longer exists in the buffer cache, a cold cache will...
Some SQL statements will be running very slow after SET ROWCOUNT or TOP is used. SET ROWCOUNT and TOP are used to tell SQL Server to select a...
The following is an example shows a SQL statement with an IN List expression. The SQL retrieves records from EMPLOYEE table that EMP_DEPT should...
Here the following is an example SQL statement with a DECODE expression syntax. select * from employee where decode(emp_dept, 'AAA',...
The following is an example shows a SQL statement with two conditions “emp_dept=dpt_id and emp_dept<'L'” . select * from employee, department...
Here is an example SQL that retrieves data from EMPLOYEE table with employee’s ID code in EMP_SUBSIDIARY table. select * from employee a where...
The following is an example shows a SQL statement with two potential table join paths. “Employee to Department” and “Department to Employee” are...
Here is an example SQL that retrieves data from EMPLOYEE table with “emp_id < 710000” and employee’s department code exists in DEPARTMENT table....
The following is an example shows a SQL statement with a variable on the IN List operator. The SQL retrieve records from EMPLOYEE table that...
Semi-join is introduced in Oracle 8.0. It provides an efficient method of performing a WHERE EXISTS or WHERE IN sub-queries. A semi-join returns...
Separate names with a comma.