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
          cust "USES" car
          customers cust
,         car       car
          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