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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ImportantReminder: <strong>Reports</strong> & <strong>Queries</strong> cannot be used to create:• Insert queries.• Update queries.• Delete queries.Principle:To create a query, you must:• specify the method for creating the query (wizard/description window or SQL code).• specifying the type of the query (insert, update, …).• specify (if necessary) the WinDev or WebDev analysis containing the description of the data files onwhich the query will be based.• select the items to use.• entering the characteristics of the query (selection conditions, sort, …).The following paragraphs present the different types of queries and their creation mode.2.2 Select query2.2.1 OverviewA Select query (corresponding SQL <strong>com</strong>mand: SELECT) is used to select records in a database. This type ofquery is the most <strong>com</strong>monly used.To perform this selection, the following information is required:• the type of join between the files used (if several data files are used),• the selection conditions of the records (customers who live in Paris, products whose price is greaterthan 40 Euros, …),• the grouping of the item values (grouping the products by type, the customers by age, …),• the operations performed on the content of the items (total amount of the orders for a customer, averagesum spent per customer, …),• the sort of the result items of the query (result sorted by zip code, price, and so on …).This information represents the characteristics of the query. See “Characteristics of a query”, page 191 formore details.For example, you want to find out the total of all the orders by people living in Iowa. Only the customers with atotal order amount exceeding $3,000 will be considered. The result will be sorted by total order amount inascending order.Part 2: Query editor 167

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

Saved successfully!

Ooh no, something went wrong!