Neidio i'r brif gynnwys

Aliasing Expressions with AS

yn DPQL Reference
Rhestr o awduron
Cyhoeddwyd: May 22, 2018|Diweddarwyd diwethaf: Nov 3, 2022

Sometimes one of the columns returned in the results of your report will be the result of a complex expression. For example, you might have a report with:

SELECT DPQL_PERCENT(tickets.total_to_first_reply < 3600)
copy

It’s not very readable to show this as the column header:

../_images/without-aliasing.png

You can change how the expression is displayed using AS.

After the expression, use AS 'string', where string is a readable name for the resulting column.

For example,

SELECT DPQL_PERCENT(tickets.total_to_first_reply < 3600) AS 'Percentage within 1 hour'
copy

This results in more readable output on the table:

../_images/with-aliasing.png

The readable name is also used on graphs.

DefnyddiolAnnefnyddiol
tudalen nesafArchived Status
tudalen flaenorolGeneral Expression Format

Mewngofnodwch neu cofrestrwch i gyflwyno sylw.