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 ADManager Plus?

                    New to ADSelfService Plus?

                      • Related Articles

                      • 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 ...
                      • 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 ...
                      • 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 ...
                      • 5.Order by

                        GROUP BY If you want to group by 5th column then the order by should be in the same line. SELECT wo.WORKORDERID AS "Request ID", wo.TITLE AS "Subject", cd.CATEGORYNAME AS "Category", std.STATUSNAME AS "Request Status", ti.FIRST_NAME AS "Technician" ...
                      • SAML Auto Login with ADFS (in Intranet)

                        Steps to enable Auto-logon: Step 1: In the AD FS server, under Authentication Methods, make sure that Windows Authentication is selected. Step 2: Run the below powershell query to check if "Chrome" is present in the supported WIA agents: ...