USoft Rule Language Examples: GROUPED BY Clause

Previous Next

See Also

USoft table constraint statements with GROUPED BY in the main clause are rare but legal. The GROUPED BY clause in USoft Rule Language may occur only as the clause immediately following FOR clause. In subqueries, GROUP BY must be used as in SQL.

 

USoft Rule Language

SQL Equivalent

FOR        customers cust

,        car

CONNECTED AS

 cust "USES" car

GROUPED BY

 customers cust

,        car

DO NOT ALLOW THAT

 count(*) > 1

select        cust.type

,                car.type

from        customer cust

,                car

relate        cust "USES" car

group by        cust.type

,                car.type

having        count(*) > 1