USoft Rule Language Examples: GROUPED BY Clause

Previous Next

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       car
CONNECTED AS
          cust "USES" car
GROUPED BY
          customers cust
,         car       car
DO NOT ALLOW THAT
          COUNT(*) > 1

SELECT    cust.type
,         car.type
FROM      customer cust
,         car      car
RELATE    cust "USES" car
GROUP BY  cust.type
,         car.type
HAVING    count(*) > 1

 

See Also

USoft Rule Language