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...
The following is an example shows a SQL statement with two union operator in a subquery. The SQL retrieve records from EMPLOYEE table that EMP_ID...
The LIKE is a logical operator that determines if a character string matches a specified pattern. A pattern may include regular characters and...
The following is an example shows a DELETE SQL statement with subquery. The SQL delete records from emp_subsidiary that should satisfy with three...
Here the following is SQL statement with multiple OR subqueries. SELECT * FROM employee WHERE emp_id IN (SELECT emp_id FROM emp_subsidiary where...
The following is an example shows a SQL statement with “Group by” expression. The SQL retrieve the sum of historical salary from table...
Here the following is a simple SQL statement with a CASE expression syntax. SELECT * FROM employee WHERE CASE WHEN emp_salary< 1000 THEN 'low'...
Here the following is a simple SQL statement with a “< ALL (Subquery)” syntax. SELECT * FROM employee a WHERE a.emp_salary <ALL(SELECT...
I showed you how to tune an Update statement with a simple subquery in my last blog, a more complex update statement will be discussed in the...
Here the following is a very simple SQL statement with two Max() functions in select list. select max(emp_salary),max(emp_id) from employee;...
It is not another SQL Tuning tool There have been already a lot of SQL tuning products in the market providing better query plan visualization,...
The following is an example shows an Update SQL statement with an “IN” subquery. It updates records from emp_subsidiary that satisfies the “IN”...
The following is an example shows a SQL statement with “Not Exists” expression. The SQL retrieve records from emp_subsidiary that satisfy with the...
CTE stands for common table expression. A CTE allows you to define a temporary named result set that available temporarily in the execution scope...
Separate names with a comma.