Page History
...
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.
...
When specifying the condition, value must be an exact match of the column value in the worksheet. String value comparisons are case sensitive. You can use the UPPER() function to perform case insensitive comparisons. You can find more information here. Or you can use the SET IGNORECASE TRUE command to make string comparisons be case insensitive.
...
The GROUP BY clause is used in combination with aggregate functions to group the results by one or more columns. See the SQL Functions page for a list of aggregate functions supported by ExcelSQL.
...
The HAVING clause states the qualifying conditions for aggregated values. It is used in conjunction with aggregate functions to filter aggregated values.
...
There are different types of joins available in ExcelSQL: INNER JOIN, LEFT JOIN and RIGHT JOIN. INNER JOIN returns rows when there is a match on both tables. LEFT JOIN returns all rows from the left table even if there are no matches in the right table. RIGHT JOIN returns all rows from the right table even if there are no matches in the left table. You can find the syntax for the different joins below.
INNER JOIN clause
SELECT column1, column2 FROM worksheet1 INNER JOIN worksheet2 ON worksheet1.column1 = worksheet2.column2
...
Code Block |
---|
SELECT C.name, O.customerID FROM Customers C LEFT JOIN Orders O ON C.customerID = O.CustomerID UNION ALL SELECT C.name, O.customerID FROM Customers C RIGHT JOIN Orders O ON C.customerID = O.customerID |
Self Join
SELECT Column1, Column2 FROM Worksheet1 A, Worksheet1 B WHERE A.Column1 = B.Column1
...
Code Block |
---|
SELECT Project.P_id, Project.budget FROM (SELECT E.E_id, E.Salary FROM Employee E) emp INNER JOIN Project on emp.E_id = Project.P_id |
ExcelSQL Arithmetic Operators
...
Code Block |
---|
SELECT * FROM [bi].zips WHERE city = 'Cochin' GO SELECT * FROM [bi].zips WHERE city <> 'Cochin' GO SELECT * FROM [bi].zips WHERE zipcode <= 682017 GO |
Configuration Functions
SELECT @@database
...
Code Block |
---|
SET COLLATION ENGLISH STRENGTH PRIMARY |
See the the SHOW Commands page for additional information about commands used to describe database schema objects.