Skip to content

Commit

Permalink
Merge pull request #183 from noi-techpark/issue-135
Browse files Browse the repository at this point in the history
Issue 135
  • Loading branch information
Peter Moser committed Nov 30, 2020
2 parents 4aac76b + 58ae31f commit 059ff40
Showing 1 changed file with 39 additions and 2 deletions.
41 changes: 39 additions & 2 deletions source/howto/mobility/getstarted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ form, with an implicit :strong:`and` among the filters, therefore
evaluation of the filters takes place only if all filters would
individually evaluate to :strong:`true`.


.. _mobility-select-clause:

The :literal:`SELECT` Clause
Expand Down Expand Up @@ -545,8 +546,6 @@ the following limitations:
:literal:`max`, :literal:`avg`, and :literal:`count`
* :strong:`No` string selection or manipulation is allowed, but left as
a post-processing task
* Functions can be use :strong:`only` with the :literal:`flat`
representation
* When a function is used together with other targets, these are used
for grouping purposes. For example:
:literal:`select=sname,max(smetadata.capacity),min(smetadata.capacity)`
Expand Down Expand Up @@ -596,6 +595,44 @@ of values, respectively:
* :literal:`where=smetadata.capacity.gt.100,smetadata.municipality.eq."Bolzano -
Bozen"` same as previous query, but only parking lots in Bolzano are shown.

.. _logical-operators:

Logical Operators
~~~~~~~~~~~~~~~~~

.. versionadded:: 2020.11 description of logical operators

Besides the operators described in section
:ref:`mobility-where-clause`, |odh| supports the use of logical
operators :literal:`and` and :literal:`or` in the :literal:`WHERE`
clause, like these examples show.

.. code-block::
:linenos:
and(x.eq.3,y.eq.5)
x.eq.3,y.eq.5
or(x.eq.3,y.eq.5)
or(x.eq.3,and(y.gt.5,y.lt.10))
Logical operators are followed by a comma-separated list of `targets`,
which can be filters (see previous section for some example), or other
logical operators. In complex logical expression, parentheses are
employed to assign precedence. Lines 1 and 2 above are equivalent,
because the default logical operator is :literal:`and`.

The above example will be translated into Postgres as follows:

.. code-block::
:linenos:
(x = 3 AND y = 5)
(x = 3 AND y = 5)
(x = 3 OR y = 5)
(x = 3 OR (y > 5 AND y < 10))
Additional Parameters
~~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit 059ff40

Please sign in to comment.