Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What are the ways to use the query conditions of big data report?

Shulou Source: shulou.com Published: 2022-06-01 02:03:04 11月02日 Update

Big data report query conditions of the use of which, many novices are not very clear, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.

As we all know, when designing reports, the data that we need to show is rarely fixed, and we often need to use query conditions to filter out the data we want. In short, the same report can present different data under different parameter controls.

So the question is, what methods do reporting tools generally use to achieve this requirement?

Use the SQL parameter

First of all, of course, it must be said that SQL, under normal circumstances, different filtering conditions will correspond to different WHERE conditions in the fetch SQL, and the report tool can correspond the report parameters to the parameters of SQL, so that different SQL will be generated when entering different report parameters.

If we want to make a report with query conditions, take the order date as the retrieval condition, and query the data in the order information table in different date ranges. The data columns include: order ID, customer ID, order date, delivery date, shipper, owner name, owner region, order amount.

Follow me, let's take the dry report as an example. First, set two parameters, named startdate and enddate:

Then the SQL of the report is written in the form of parameters, and the "?" (question mark) is used in the SQL statement to indicate the parameters:

Select order ID, customer ID, order date, Shipping date, shipper, owner name, owner region, order amount from order Information form where order date >? And order date

Tags: Parameters reports dates orders data queries differences shippers conditions information statements regions tools expressions names customers configurations characters strings amount Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Xiaomi Apple MySQL Shulou Technology