Thumbnail image for The BOOLEAN Datatype in Oracle

The BOOLEAN Datatype in Oracle

Oracle database has a BOOLEAN datatype only in PL/SQL, not in SQL. There is no direct way to represent that a column value is TRUE or FALSE. However, the BOOLEAN datatype can be easily simulated in Oracle with these implementation ideas.

Read the Full Article →
Thumbnail image for The Difference between CHAR, VARCHAR and VARCHAR2

The Difference between CHAR, VARCHAR and VARCHAR2

Oracle has three datatypes to store strings. – CHAR, VARCHAR and VARCHAR2. How do they differ from each other? When should you use which? This article gives you the lowdown on the subject.

Read the Full Article →

Scalar Subquery: SELECT within SELECT!

A scalar subquery is a single row, single column query, which looks just like a column or function in the SELECT clause. Here’s a look at the unique characteristics and benefits of this feature in Oracle.

Read the Full Article →
Thumbnail image for IN = EXISTS, but beware: NOT IN is not the same as NOT EXISTS!

IN = EXISTS, but beware: NOT IN is not the same as NOT EXISTS!

In Oracle SQL queries, IN and EXISTS are interchangeable. Many of us assume therefore, that NOT IN and NOT EXISTS are also interchangeable. That’s not the case though.

Read the Full Article →
Thumbnail image for Which is faster – IN or EXISTS?

Which is faster – IN or EXISTS?

A question asked multiple times over on Oracle forums: Which is faster – IN or EXISTS? The short answer, post-Oracle 9i is: Both are pretty much the same!

Read the Full Article →
Thumbnail image for What are Inline Views in Oracle?

What are Inline Views in Oracle?

An inline view is a subquery with an alias that you can use within a SQL statement, often used in queries for Top-N analysis. An inline view behaves just as if the subquery were a table name.

Read the Full Article →
Thumbnail image for Correlated Subquery

Correlated Subquery

A correlated subquery is a type of nested subquery that uses columns from the outer query in its WHERE clause. While a simple subquery is evaluated only once for each table, a correlated subquery is evaluated once for each row.

Read the Full Article →
Thumbnail image for Understanding Subqueries and Their Types

Understanding Subqueries and Their Types

A subquery – that is, a query within a query – can be of various flavors in Oracle. Subqueries may be simple or correlated, nested or scalar. A closer look at the types of subqueries and their purpose.

Read the Full Article →
Thumbnail image for Select Rows With Max Value

Select Rows With Max Value

Solution for selecting rows based on the maximum value of a specific table column, such as date. See it in action: script to list the latest order details of every customer’s orders.

Read the Full Article →
Thumbnail image for Why the SQL WITH clause is not exactly like a function definition

Why the SQL WITH clause is not exactly like a function definition

SQL WITH clause appears similar in concept to a function definition in procedural code, but it differs in an important way in older Oracle versions. The error ORA-32035: unreferenced query name defined in WITH clause informs you about this difference.

Read the Full Article →