• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • CPACK
    • Home
    • List packs
    • Submit pack
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

1.7 CQL Examples
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • Constraint Query Language A high level interface to SQL databases
        • library(cql/cql): CQL - Constraint Query Language
          • CQL Examples
            • CQL Simple INSERT
            • CQL Simple INSERT with retrieval of identity of the inserted
            • CQL Simple DELETE
            • CQL Simple SELECT
            • CQL Simple UPDATE
            • CQL WHERE with arithmetic comparison
            • CQL Simple INNER JOIN
            • CQL Arithmetic UPDATE with an INNER JOIN and a WHERE restriction
            • CQL: Confirm row does not exist
            • CQL: Aggregation - Count
            • CQL: Aggregation - Sum
            • CQL: Aggregation - Average
            • CQL: Maximum Value
            • CQL: Minimum Value
            • CQL: Aggregation requiring GROUP BY
            • CQL: INNER JOIN with an aggregation sub-query where the sub-query is constrained by a shared variable from the main query
            • CQL: INNER JOIN in an aggregation sub-query
            • CQL: Negation
            • CQL: EXISTS
            • CQL: Left Outer Join
            • CQL: List-based Restrictions
            • CQL: Compile time in-list constraint
            • CQL: Disjunction resulting in OR in WHERE clause
            • CQL: Disjunction resulting in different joins (implemented as a SQL UNION)
            • CQL: Disjunction resulting in different SELECT attributes (implemented as separate ODBC queries)
            • CQL: ORDER BY
            • CQL: DISTINCT
            • CQL: SELECT with NOT NULL restriction
            • CQL: First N
            • CQL: Self JOIN
            • CQL: Removing null comparisions
            • CQL: Three table JOIN
            • CQL: Three table JOIN with NOLOCK locking hint
            • CQL: SELECT with LIKE
            • CQL: Writing exceptions directly to the database
            • CQL: TOP N is Parametric
            • CQL: Using compile_time_goal/1
            • CQL: ON
            • CQL: Expressions In Where Restrictions
            • CQL: Explicitly avoid the "No WHERE restriction" message
            • CQL: HAVING
            • CQL: INSERT and UPDATE value in-line formatting
            • CQL: Negations in WHERE Clauses
            • CQL: Predicate-generated Attribute Values
            • CQL: INSERT from SELECT

1.7.24 CQL: Disjunction resulting in different joins (implemented as a SQL UNION)

{[],
 se_lt_x :: [a-A, c-C]
 =*=
 (se_lt_y :: [d-A] ; se_lt_z :: [g-A])}

The generated SQL is:

SELECT
  x43.c
 FROM
  (se_lt_x x43 INNER JOIN se_lt_z z6 ON x43.a=z6.g AND z6.g=x43.a)

UNION

SELECT
  x44.c
 FROM
  (se_lt_x x44 INNER JOIN se_lt_y y16 ON x44.a=y16.d AND y16.d=x44.a)

ClioPatria (version V3.1.1-51-ga0b30a5)