pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/phpcr/phpcr.github.io/blob/master/documentation/reference/jcr-sql2.md

lobal-68dd150ce6c8e711.css" /> phpcr.github.io/documentation/reference/jcr-sql2.md at master · phpcr/phpcr.github.io · GitHub
Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 1.27 KB

File metadata and controls

44 lines (30 loc) · 1.27 KB
layout title
default
JCR-SQL2 Reference

JCR-SQL2 is a query language similar to SQL which is used by JCR and thus also PHPCR.

Some things to note:

  • Unlike most other SQL dialects, JCR-SQL2 only supports SELECT statements.
  • JCR-SQL2 selects from node types not tables.
  • LIMIT BY and OFFSET are not supported.
  • Namespaced node types should always be surrounded by square brackets ([ and ]).

In the following examples I will use the PHPCR shell to execute the queries.

Basics

The basic query grammer is defined as:

Query ::= 'SELECT' columns

'FROM' Source

['WHERE' Constraint]

['ORDER BY' orderings]

This should be familiar to anybody with a background in SQL.

So WHERE and ORDER BY are optional, and SELECT and FROM are mandatory.

  • columns can either be a wildcard (e.g. * or selector.*) or a list of column names or both.
  • source can be a simple node type name, or a join source.
  • where is a list of criteria for selecting the records
  • order by determines which fields will be used to order the result set and in which direction.

The following are valid statements

{% highlight sql %} SELECT title FROM [myCms:article]; SELECT * FROM [myCms:article] ORDER BY title SELECT a.* FROM [myCms:article] AS a; {% endhighlight %}

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy