Database reference guide |
HOME |
Queries limits and constraintsThis section provides an overview of the limits that need to be considered when working with queries in Engine. Max length of an NSQL statementThe maximum length of any NSQL statement is 64K. There are no theoretical limits on the number of fields that can be specified in the select clause of a query. Tables in a FROM clauseThere is no theoretical limit on the number of tables that can be specified in the FROM clause of an NSQL statement. However, the maximum number of links that can be crossed is 3.
ViewableA table is viewable at another table if it comes from the ONE side of a
Query RulesBy default, the resolution level of a select query (i.e. the owner table of the result domain) is dependent on the data structure and the order in which the tables are specified in the FROM clause. Correct control over the resolution level can be obtained by use of the DISTINCTROW keyword. The default resolution is the MANY table in a ONE to MANY relationship
Where ClauseFields that are listed in the where clause must be linked to the resolution table of the query. There is no theoretical limit on the number of ANDclauses that can be specified in the Where clause of a SQL statement. However, the length of the statement must not exceed the maximum length of an expression (64K) GROUP BY ClauseA GROUP BY Clause can only be executed against the following intrinsic functions; COUNT, SUM, MIN, RMEAN, MEAN, MAX, STDEV, STDEVS This means that Up to 20 columns can be specified after the GROUP By clause. However, the number of discrete values on the resulting Y axis must not exceed 2 billion, and the maximum number of cells in the crosstab must not exceed the amount allowed by available memory. (See Crosstabs lmits and constraints for more details) PIVOT By ClauseThe PIVOT By Clause can only be included after a GROUP BY Clause. Only one column can be specified for a Pivot By clause. Further columns will be ignored. Multiple DistinctEngine 3.0 and later supports Multiple Distinct where the combination of all the columns specified in the distinct clause is evaluated. The following statement will return all unique combinations of Product and CustID:
Transactions Table SELECT DISTINCT CUSTID, PRODUCT FROM TRANSACTIONS;
Engine 3.0 results The combined width of all the fields specified in the distinct clause must not exceed 1024. IN StatementThere is no theoretical limit on the number of values that can be specified in an IN clause. The practical limit is governed by the size of the query or expression which must not exceed 64K. Sub SelectsWhen using a sub-select in NSQL, the sub query must return:
If the sub-select returns a domain, the only operator that can be used with it is IN, and the IN operator can take a maximum of 1024 values. If the sub-select domain returns more than 1024 discrete values, an "Invalid Definition" error will be raised. The following query selects all records from the family table for towns that contain 5 bedroom houses. If the number of towns that contains 5 bedrooms exceeds 1024, the query will fail. SELECT * FROM [DEMO].[FAMILY] WHERE [DEMO].[FAMILY].[TOWN] IN (SELECT DISTINCT TOWN FROM [DEMO].[FAMILY] WHERE BEDROOMS=”5”); |
Online & Instructor-Led Courses | Training Videos | Webinar Recordings | ![]() |
|
![]() |
© Alterian. All Rights Reserved. | Privacy Policy | Legal Notice | ![]() ![]() ![]() |