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. 








                  New to ADSelfService Plus?

                    • Related Articles

                    • Select site for available groups drop down

                      Drop down shown in the screenshot will be appeared when there are more than 2500 support groups. This is shown to make it easier for the user to select and associate groups when the count is more.
                    • Close a request upon receiving a response containing a closing statement.

                      Usecase: Close a request when the requester replies to the ticket with close phrase. Steps to follow: Goto Admin > Developer Space > Global function > New > Paste the content from the attachment Global function_4.txt and save it with a name. Update ...
                    • Auto select the domain name in the login page

                      Domains of a user can be auto filled during login. This can be achieved by searching for the domain names associated with the provided username in the login page. Say, username 'vembu' exists in only one domain 'Zoho'. So, when we enter the username ...
                    • 1. Query Basics

                      Basic Query: SELECT wo.WORKORDERID AS "Request ID", wo.TITLE AS "Subject", aau.FIRST_NAME AS "Requester", ti.FIRST_NAME AS "Technician", cd.CATEGORYNAME AS "Category", std.STATUSNAME AS "Request Status" FROM WorkOrder wo LEFT JOIN SDUser sdu ON ...
                    • To close a request upon receiving a response from the requester containing the given statement.(14300)

                      Usecase: Close a request when the requester replies to the ticket with close phrase. Steps to follow: 1.Goto Admin > Developer Space > Global function > New > Paste the content from the attachment Global function_4.txt and save it with a name. ...