Adapter Online Help > TDV Microsoft Dynamics GP Adapter > SQL Compliance > SELECT Statements
 
SELECT Statements
A SELECT statement can consist of the following basic clauses.
SELECT
INTO
FROM
JOIN
WHERE
GROUP BY
HAVING
UNION
ORDER BY
LIMIT
SELECT Syntax
The following syntax diagram outlines the syntax supported by the Microsoft Dynamics GP adapter:
SELECT {
[ TOP <numeric_literal> ]
{
*
| {
<expression> [ [ AS ] <column_reference> ]
| { <table_name> | <correlation_name> } .*
} [ , ... ]
}
[ INTO csv:// [ filename= ] <file_path> [ ;delimiter=tab ] ]
{
FROM <table_reference> [ [ AS ] <identifier> ]
}
[ WHERE <search_condition> ]
}
 
<expression> ::=
| <column_reference>
| @ <parameter>
| ?
| COUNT( * | { <expression> } )
| { AVG | MAX | MIN | SUM | COUNT } ( <expression> )
| <literal>
| <sql_function>
 
<search_condition> ::=
{
<expression> { = | > | < | >= | <= | <> | != | LIKE | IN | NOT IN | AND } [ <expression> ]
} [ { AND | OR } ... ]
Examples
Return all columns:
SELECT * FROM Customer
Rename a column:
SELECT "Name" AS MY_Name FROM Customer
Search data:
SELECT * FROM Customer WHERE Name = 'Jon Doe';
The Microsoft Dynamics GP APIs support the following operators in the WHERE clause: =, >, <, >=, <=, <>, !=, LIKE, IN, NOT IN, AND.
SELECT * FROM Customer WHERE Name = 'Jon Doe';