Combined Query Technique

The combined query technique combines the results of one query with the results of another query into single query or data provider.

Things to remember:

1. Queries that your combine must contain same number of objects.

2. You must use objects of same type

3. UNION is used as default behavior not UNION ALL.

4. You can use up to eight (8) queries

UNION ALL Vs UNION

UNION ALL selects all values, does not eliminate duplicate rows.

SELECT FirstName, LastName, Age FROM Tab1
UNION ALL
SELECT FirstName, LastName, Age FROM Tab2

UNION select all the matching rows and eliminate any duplicate.

SELECT FirstName, LastName, Age FROM Tab1
UNION
SELECT FirstName, LastName, Age FROM Tab2

GO

Remember to select same data type columns

Business Objects allows us to create 3 types of combination queries

Union , Intersect and Minus on set of data created in a single data provider.

Leave a Reply