13.07.2015 Views

Reports & Queries - Source : www.pcsoft-windev-webdev.com

Reports & Queries - Source : www.pcsoft-windev-webdev.com

Reports & Queries - Source : www.pcsoft-windev-webdev.com

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Note: The items displayed in the result of the Union query correspond to the items of the first query run. Therefore,in our example, the people who are both customer and prospect, whose name starts with the letter ’A’and who live in Paris will only appear once in the result of the query.This query generates the following SQL code ("SQL code" from the popup menu of the query):SELECT CUSTOMER.CustomerLName AS CustomerLNameFROM CUSTOMERWHERE CUSTOMER.CustomerName LIKE ’A%’UNIONSELECT CUSTOMER.CustomerLName AS CustomerLNameFROM CUSTOMERWHERE CUSTOMER.City LIKE ’Paris’In order for the people who are both customer and prospect, whose name starts with the letter ’A’ and wholive in Paris to appear several times in the result of the query, the SQL code must be:SELECT CUSTOMER.CustomerLName AS CustomerLNameFROM CUSTOMERWHERE CUSTOMER.CustomerName LIKE ’A%’UNION ALLSELECT CUSTOMER.CustomerLName AS CustomerLNameFROM CUSTOMERWHERE CUSTOMER.City LIKE ’Paris’2.6.2 Creating a Union query via the description windowTo create a new Union query via the description window:1. Start the wizard for creating queries:• click among the quick access buttons.• click "Query" in the wheel that is displayed.2. Specify that you want to create a Union query ("Union (UNION)").3. If your project is not linked to a WinDev or WebDev analysis, specify the analysis to which the querymust be linked.4. Validate the wizard screen. The description window of the query is displayed. This window enables youto describe your query.Note: See “Description window of a Union query”, page 190 for more details about this window.176Part 2: Query editor

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!