2018-09-05 18:19:49 -04:00
|
|
|
[role="xpack"]
|
|
|
|
[testenv="basic"]
|
|
|
|
[[sql-operators]]
|
|
|
|
=== Comparison Operators
|
|
|
|
|
2018-10-23 08:28:23 -04:00
|
|
|
Boolean operator for comparing against one or multiple expressions.
|
2018-09-05 18:19:49 -04:00
|
|
|
|
2019-04-01 11:01:03 -04:00
|
|
|
[[sql-operators-equality]]
|
|
|
|
==== `Equality (=)`
|
2018-09-05 18:19:49 -04:00
|
|
|
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{sql-specs}/filter.sql-spec[whereFieldEquality]
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2019-04-01 11:01:03 -04:00
|
|
|
[[sql-operators-null-safe-equality]]
|
|
|
|
==== `Null safe Equality (<=>)`
|
2018-11-26 08:02:02 -05:00
|
|
|
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2019-03-25 09:22:59 -04:00
|
|
|
include-tagged::{sql-specs}/docs/docs.csv-spec[nullEqualsCompareWithNull]
|
2018-11-26 08:02:02 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2019-03-25 09:22:59 -04:00
|
|
|
include-tagged::{sql-specs}/docs/docs.csv-spec[nullEqualsCompareTwoNulls]
|
2018-11-26 08:02:02 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
|
2019-04-01 11:01:03 -04:00
|
|
|
[[sql-operators-inequality]]
|
|
|
|
==== `Inequality (<> or !=)`
|
2018-09-05 18:19:49 -04:00
|
|
|
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{sql-specs}/filter.sql-spec[whereFieldNonEquality]
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2019-04-01 11:01:03 -04:00
|
|
|
[[sql-operators-comparison]]
|
|
|
|
==== `Comparison (<, <=, >, >=)`
|
2018-09-05 18:19:49 -04:00
|
|
|
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{sql-specs}/filter.sql-spec[whereFieldLessThan]
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2019-04-01 11:01:03 -04:00
|
|
|
[[sql-operators-between]]
|
|
|
|
==== `BETWEEN`
|
2018-09-05 18:19:49 -04:00
|
|
|
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{sql-specs}/filter.sql-spec[whereBetween]
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2019-04-01 11:01:03 -04:00
|
|
|
[[sql-operators-is-null]]
|
|
|
|
==== `IS NULL/IS NOT NULL`
|
2018-09-05 18:19:49 -04:00
|
|
|
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{sql-specs}/filter.sql-spec[whereIsNotNullAndIsNull]
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2019-04-01 11:01:03 -04:00
|
|
|
[[sql-operators-in]]
|
|
|
|
==== `IN (<value1>, <value2>, ...)`
|
2018-10-23 08:28:23 -04:00
|
|
|
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{sql-specs}/filter.sql-spec[whereWithInAndMultipleValues]
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2018-09-05 18:19:49 -04:00
|
|
|
[[sql-operators-logical]]
|
|
|
|
=== Logical Operators
|
|
|
|
|
|
|
|
Boolean operator for evaluating one or two expressions.
|
|
|
|
|
2019-04-01 11:01:03 -04:00
|
|
|
[[sql-operators-and]]
|
|
|
|
==== `AND`
|
2018-09-05 18:19:49 -04:00
|
|
|
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{sql-specs}/filter.sql-spec[whereFieldAndComparison]
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2019-04-01 11:01:03 -04:00
|
|
|
[[sql-operators-or]]
|
|
|
|
==== `OR`
|
2018-09-05 18:19:49 -04:00
|
|
|
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{sql-specs}/filter.sql-spec[whereFieldOrComparison]
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2019-04-01 11:01:03 -04:00
|
|
|
[[sql-operators-not]]
|
|
|
|
==== `NOT`
|
2018-09-05 18:19:49 -04:00
|
|
|
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{sql-specs}/filter.sql-spec[whereFieldEqualityNot]
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
[[sql-operators-math]]
|
|
|
|
=== Math Operators
|
|
|
|
|
|
|
|
Perform mathematical operations affecting one or two values.
|
|
|
|
The result is a value of numeric type.
|
|
|
|
|
2019-04-01 11:01:03 -04:00
|
|
|
[[sql-operators-plus]]
|
|
|
|
==== `Add (+)`
|
2018-09-05 18:19:49 -04:00
|
|
|
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{sql-specs}/arithmetic.sql-spec[plus]
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2019-04-01 11:01:03 -04:00
|
|
|
[[sql-operators-subtract]]
|
|
|
|
==== `Subtract (infix -)`
|
2018-09-05 18:19:49 -04:00
|
|
|
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{sql-specs}/arithmetic.sql-spec[minus]
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2019-04-01 11:01:03 -04:00
|
|
|
[[sql-operators-negate]]
|
|
|
|
==== `Negate (unary -)`
|
2018-09-05 18:19:49 -04:00
|
|
|
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{sql-specs}/arithmetic.sql-spec[unaryMinus]
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2019-04-01 11:01:03 -04:00
|
|
|
[[sql-operators-multiply]]
|
|
|
|
==== `Multiply (*)`
|
2018-09-05 18:19:49 -04:00
|
|
|
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{sql-specs}/arithmetic.sql-spec[multiply]
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2019-04-01 11:01:03 -04:00
|
|
|
[[sql-operators-divide]]
|
|
|
|
==== `Divide (/)`
|
2018-09-05 18:19:49 -04:00
|
|
|
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{sql-specs}/arithmetic.sql-spec[divide]
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2019-04-01 11:01:03 -04:00
|
|
|
[[sql-operators-remainder]]
|
|
|
|
==== `Modulo or Remainder(%)`
|
2018-09-05 18:19:49 -04:00
|
|
|
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{sql-specs}/arithmetic.sql-spec[mod]
|
|
|
|
--------------------------------------------------
|
2019-02-12 09:50:21 -05:00
|
|
|
|
|
|
|
[[sql-operators-cast]]
|
|
|
|
=== Cast Operators
|
|
|
|
|
2019-04-01 11:01:03 -04:00
|
|
|
[[sql-operators-cast-cast]]
|
|
|
|
==== `Cast (::)`
|
2019-02-12 09:50:21 -05:00
|
|
|
|
|
|
|
`::` provides an alternative syntax to the <<sql-functions-type-conversion-cast>> function.
|
|
|
|
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
2019-03-25 09:22:59 -04:00
|
|
|
include-tagged::{sql-specs}/docs/docs.csv-spec[conversionStringToLongCastOperator]
|
2019-02-12 09:50:21 -05:00
|
|
|
--------------------------------------------------
|