background image
<< Correlating Queries to Optimize a Script | simple correlated query >>
<< Correlating Queries to Optimize a Script | simple correlated query >>

Simple Correlated Queries

Creating Vuser Scripts
Chapter 10, page 176
Database Vuser Scripts · Correlating Database Statements
In
Simple Correlated Queries -- Examples
The following examples use two tables in a database, employees and payment.
Employees
Payment:
In the first example, a clerk in a company's personnel department wants to perform
a query to retrieve the salary for an employee named John. However, the table that
contains the salaries only lists the salaries by employee ID. The clerk does not
know John's ID, therefore, he will have to wait for the result of the first query before
performing the second query. The clerk can perform both queries with a single
operation by nesting the queries.
id
name
id
year
salary
777
John
777
1996
15,000
778
Bill
778
1995
18,000
779
Mike
779
1996
25,000
...
...
...
...
...