Reader small image

You're reading from  Pentaho 5.0 Reporting by Example: Beginner's Guide

Product typeBook
Published inAug 2013
PublisherPackt
ISBN-139781782162247
Edition1st Edition
Tools
Right arrow
Author (1)
Right arrow

Time for action – modifying the SQL query


We will now modify the previously defined SQL query with the objective of getting a data set that is more suitable to working with groups.

  1. Go to the Data panel (in the Panel tab). Within the Data Sets tree, we will right-click on the JDBC: sakila db node and select the Edit Datasource... option, as shown in the following screenshot:

  2. Just as in the previous chapter, we will be presented with the Connections Editor window. What we will do here is select the sakila db item within the Connection section; then, in the Available Queries section, we will select CountryCustomerAmount.

  3. Now, in the Query section, we will select the SQL query written there and delete it and then replace it with the following code:

    SELECT country.country_id, country.country, customer.first_name, customer.last_name, SUM(payment.amount) sum_amount
    FROM payment 
    INNER JOIN customer ON customer.customer_id=payment.customer_id
    INNER JOIN address ON address.address_id=customer.address_id...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Pentaho 5.0 Reporting by Example: Beginner's Guide
Published in: Aug 2013Publisher: PacktISBN-13: 9781782162247