2. Select Statement

2. Select Statement

The SELECT statement is used to query the database and retrieve the fields that you specify. You can select as many fields as you want.

Adding columns to the query:

Refer to the below KB article for the Database schema.


You will find three columns in the below link.




If you need to add a column 'Request mode' in the query, refer to the sample below.

SELECT wo.WORKORDERID AS "Request ID",
       wo.TITLE AS "Subject",
       cd.CATEGORYNAME AS "Category",
       std.STATUSNAME AS "Request Status",
       mdd.MODENAME "Request Mode" FROM WorkOrder wo
LEFT JOIN WorkOrderStates wos ON wo.WORKORDERID=wos.WORKORDERID
LEFT JOIN CategoryDefinition cd ON wos.CATEGORYID=cd.CATEGORYID
LEFT JOIN StatusDefinition std ON wos.STATUSID=std.STATUSID
LEFT JOIN ModeDefinition mdd ON wo.MODEID=mdd.MODEID
WHERE (wo.ISPARENT='1')
  AND wo.CREATEDTIME >= <from_thismonth>
  AND wo.CREATEDTIME <= <to_thismonth>

Column Display Name:

Column display name are used to give a column temporary name.

Column display name are often used to make column names more readable.

"Request ID"
"Subject"
"Request Status"

You can change to any name as per your Requirement.