You need to enable JavaScript to run this app.
Torch Log Service

Torch Log Service

Copy page
Download PDF
SQL syntax
AS syntax
Copy page
Download PDF
AS syntax
The AS syntax is used to set an alias for a specified column. This article introduces the AS syntax format and examples.​
Demo center​
The TLS Demo Center provides SQL syntax demos to help you quickly experience the features.​
Warning​
The data in the Demo Center is demonstration data; please do not use it in production environments.​
Syntax format​
The format of AS syntax is as follows.​
​
* | SELECT select_expression AS Alias​
​
​
Parameter​
Description​
select_expression​
Analysis expressions can be log fields, expressions, SQL functions, asterisks (), and more. Among them, when set to an asterisk (), that is, *| SELECT *, it indicates that all fields of the log are returned.​
Alias​
Set an alias for analysis results.​
Notice​
When a column alias specified using AS syntax contains special characters (such as spaces, hyphens-, and more), double quotation marks"" must be used to enclose it, for example, "r-w" and "Time-1".​
​
Syntax example​
Example 1​
  • Scenarios​
  • Count the website's page views.​
  • Query and analysis statement​
  • ​
    * | SELECT COUNT(*) AS PV​
    ​
  • Query and analysis results​
  • ​Image​​
Example 2​
  • Scenarios​
  • Calculate the value of the ReqSize field divided by 10, and set the alias to ReqSize/10.​
  • Query and analysis statement​
  • ​
    * | SELECT ReqSize / 10 AS "ReqSize/10"​
    ​
  • Query and analysis results​
  • ​Image​​
​
Last updated: 2025.12.05 15:33:03