The SELECT statement is a vital SQL command which is used frequently within WOW. This section contains
numerous examples in which some basic SQL knowledge will be helpful in understanding. In all of the examples
we will only need to complete the fields located in the BASIC section of an operation. For each example there
will be a screen shot followed by an explanation of its contents.
To get to this screen, click on the Insert Operation button while viewing a list of operations. The focus will be on the SQL query. SQL is not case sensitive, but entering SQL in all capital letters will simplify the coding. Take for example this simple SQL query:
SELECT * FROM pjdata.employee
This query will select all of the records in the EMPLOYEES table, which is found in the pjdata schema. The * symbol is used to collect all of the columns from the table. Most SQL queries will have the keyword FROM within the query statement. This tells the program which table(s) to select the information from. After you have entered all of the relevant data click the Insert Operation button. This will insert the SQL operation into the application.
NOTE: The SELECT statement syntax is slightly different for Microsoft's SQL Server and Access.
Microsoft SQL Server 2000 & Up
With SQL Server, the database schema notation is slightly different than, let's say, the AS/400. In the examples
below, two different and valid notations are given. In the first, note the use of two periods between the database
and table. In the second statement, notice the inclusion of OWNER between the database and table.
SELECT * FROM DATABASE..TABLE (recommended)
...or...
SELECT * FROM DATABASE.OWNER.TABLE
SELECT * FROM TABLE