• Login

DataSoft Corporation

Group By Example

In addition to supporting a GROUP BY on a column-list, Pervasive PSQL supports a GROUP BY on an expression-list or on any expression in a GROUP BY expression-list. See GROUP BY for more information on GROUP BY extensions. HAVING is not supported without GROUP BY.

Result sets and stored views generated by executing SELECT statements with any of the following characteristics are read-only (they cannot be updated). 

The selection-list contains an aggregate: 
SELECT SUM(c1) FROM t1

The selection-list specifies DISTINCT: 
SELECT DISTINCT c1 FROM t1

The view contains a GROUP BY clause: 
SELECT SUM(c1), c2 FROM t1 GROUP BY c2

The view is a join (references multiple tables): 
SELECT * FROM t1, t2


The view uses the UNION operator and UNION ALL is not specified or all SELECT statements do not reference the same table:
SELECT c1 FROM t1 UNION SELECT c1 FROM t1
SELECT c1 FROM t1 UNION ALL SELECT c1 FROM t2



The view contains a subquery that references a table other than the table in the outer query:
SELECT c1 FROM t1 WHERE c1 IN (SELECT c1 FROM t2)
Thursday, 18 April 2019 Posted in Example SQL Statements
 DataSoft Store  Knowledgebase  Contact Us
 Sitemap  Privacy Policy
    Customer Service


Copyright © 2019 DataSoft Corporation All rights reserved.