Page History
...
An object name may be quoted or unquoted. If an object name contains special characters, you must quote it whenever you refer to it. The quote identifiers supported by ExcelSQL are the square brackets ([object name]) and double quotes ("object name").
Anchor | ||||
---|---|---|---|---|
|
Table of Contents |
---|
Info |
---|
Keywords are not case-sensitive. In this document, keywords such as SELECT are capitalized for illustration purposes. |
...
Code Block |
---|
SELECT * FROM Sheet1 GO SELECT city, zipcode FROM zips GO SELECT COUNT(*) FROM zips GO SELECT SUM(population) AS [Total Population] FROM zips GO |
NO_HEADER_ROW option
NO_HEADER_ROW
...
Code Block |
---|
SELECT NO_HEADER_ROW B, C, D FROM orders LIMIT 1000 OFFSET 5 GO |
WHERE clause
The WHERE clause, sometimes called the predicate, states the qualifying conditions for a query. You can combine the ExcelSQL Arithmetic Operators and the ExcelSQL Comparison Operators in the WHERE clause. Multiple conditions can be joined by the AND and OR clauses, optionally surrounded by (parentheses) to group them. Only the records that satisfy the specified criteria are returned by the query.
...
Code Block |
---|
SELECT name, COUNT(orders) FROM zips GROUP BY name GO |
HAVING clause
The HAVING clause states the qualifying conditions for aggregated values. It is used in conjunction with aggregate functions to filter aggregated values.
...
Code Block |
---|
SELECT city, zipcode FROM zips MINUS SELECT city, zipcode FROM pins |
EXCEPT
The EXCEPT operator returns rows that are returned by the first query but not by the second query.
...
Code Block |
---|
SELECT (SELECT P_id FROM Project where E_id=1), Fname FROM Employee WHERE E_id=1 GO SELECT a,b AS total_sum FROM (SELECT SUM(expenses) AS a, SUM(Salary) AS b FROM Employee) GO SELECT * FROM Employee E WHERE E_id IN (SELECT P_id FROM Project WHERE P_id = 10001) GO |
SQL Aliases
SQL aliases are used to temporarily assign a different name to a table or column heading. Basically aliases are created to make column names more readable. The WHERE, ORDER BY, GROUP BY, HAVING and JOIN clauses also support aliases for ExcelSQL.
...
Code Block |
---|
SELECT C.name, O.customerID FROM Customers C LEFT JOIN Orders O ON C.customerID = O.customerID |
RIGHT JOIN clause
SELECT column1, column2 FROM worksheet1 RIGHT JOIN worksheet2 ON worksheet1.column1 = worksheet2.column2
...