SQL/MP Query Guide

Contents
HP NonStop SQL/MP Query Guide524488-003
ii
1. Retrieving Data: How to Write
Queries (continued)
1. Retrieving Data: How to Write Queries (continued)
Defining Predicates 1-30
Comparison Predicate 1-31
BETWEEN Predicate 1-32
LIKE Predicate 1-33
Predicates Connected by OR Operators 1-35
IN Predicate 1-36
EXISTS Predicate 1-37
Quantified Predicates 1-38
IS NULL Predicate 1-39
Multivalued Comparison Predicate 1-40
Using Multivalued Comparison Predicates in Context-Free Servers 1-41
Aggregate Functions in Predicates 1-41
Using CASE Expressions 1-43
Decoding Values 1-43
Evaluating Multiple Conditions 1-44
Computing Aggregates Based on Specific Conditions 1-45
Finding the Highest Value in a Row 1-47
Converting Long, Narrow Tables Into Short, Wide Ones 1-49
Ignoring the Largest and Smallest Values in a Set 1-51
Combining Data From More Than One Table 1-51
Types of Join Queries 1-53
Restrictions on Join Queries 1-59
Using Views With Joins 1-59
The ON Clause and the WHERE Clause in Join Queries 1-59
Using the UNION Operator 1-61
ORDER BY Clause With UNION Operator 1-63
GROUP BY and HAVING Clauses With UNION Operator 1-64
Using Collations With the UNION Operator 1-64
Developing Interactive Multistep Queries 1-65
Multilevel Group Aggregates 1-65
Computing Row Value as a Percent of All Row Values 1-66
2. The Optimizer
SQL Components and the Optimizer 2-1
SQL Executor 2-3
File System 2-3
Disk Processes 2-3
How the Optimizer Chooses an Execution Plan 2-3