|
@@ -286,3 +286,132 @@ Tse |Herber |1.45
|
|
|
Udi |Jansch |1.93
|
|
|
Uri |Lenart |1.75
|
|
|
;
|
|
|
+
|
|
|
+docsSubstring
|
|
|
+// tag::substring[]
|
|
|
+FROM employees
|
|
|
+| KEEP last_name
|
|
|
+| EVAL ln_sub = SUBSTRING(last_name, 1, 3)
|
|
|
+// end::substring[]
|
|
|
+| SORT last_name ASC
|
|
|
+| LIMIT 5
|
|
|
+;
|
|
|
+
|
|
|
+// tag::substring-result[]
|
|
|
+last_name:keyword | ln_sub:keyword
|
|
|
+Awdeh |Awd
|
|
|
+Azuma |Azu
|
|
|
+Baek |Bae
|
|
|
+Bamford |Bam
|
|
|
+Bernatsky |Ber
|
|
|
+// end::substring-result[]
|
|
|
+;
|
|
|
+
|
|
|
+docsSubstringEnd
|
|
|
+// tag::substringEnd[]
|
|
|
+FROM employees
|
|
|
+| KEEP last_name
|
|
|
+| EVAL ln_sub = SUBSTRING(last_name, -3, 3)
|
|
|
+// end::substringEnd[]
|
|
|
+| SORT last_name ASC
|
|
|
+| LIMIT 5
|
|
|
+;
|
|
|
+
|
|
|
+// tag::substringEnd-result[]
|
|
|
+last_name:keyword | ln_sub:keyword
|
|
|
+Awdeh |deh
|
|
|
+Azuma |uma
|
|
|
+Baek |aek
|
|
|
+Bamford |ord
|
|
|
+Bernatsky |sky
|
|
|
+// end::substringEnd-result[]
|
|
|
+;
|
|
|
+
|
|
|
+docsSubstringRemainder
|
|
|
+// tag::substringRemainder[]
|
|
|
+FROM employees
|
|
|
+| KEEP last_name
|
|
|
+| EVAL ln_sub = SUBSTRING(last_name, 2)
|
|
|
+// end::substringRemainder[]
|
|
|
+| SORT last_name ASC
|
|
|
+| LIMIT 5
|
|
|
+;
|
|
|
+
|
|
|
+// tag::substringRemainder-result[]
|
|
|
+last_name:keyword | ln_sub:keyword
|
|
|
+Awdeh |wdeh
|
|
|
+Azuma |zuma
|
|
|
+Baek |aek
|
|
|
+Bamford |amford
|
|
|
+Bernatsky |ernatsky
|
|
|
+// end::substringRemainder-result[]
|
|
|
+;
|
|
|
+
|
|
|
+docsStartsWith
|
|
|
+// tag::startsWith[]
|
|
|
+FROM employees
|
|
|
+| KEEP last_name
|
|
|
+| EVAL ln_S = STARTS_WITH(last_name, "B")
|
|
|
+// end::startsWith[]
|
|
|
+| SORT last_name ASC
|
|
|
+| LIMIT 5
|
|
|
+;
|
|
|
+
|
|
|
+// tag::startsWith-result[]
|
|
|
+last_name:keyword | ln_S:boolean
|
|
|
+Awdeh |false
|
|
|
+Azuma |false
|
|
|
+Baek |true
|
|
|
+Bamford |true
|
|
|
+Bernatsky |true
|
|
|
+// end::startsWith-result[]
|
|
|
+;
|
|
|
+
|
|
|
+docsRound
|
|
|
+// tag::round[]
|
|
|
+FROM employees
|
|
|
+| KEEP first_name, last_name, height
|
|
|
+| EVAL height_ft = ROUND(height * 3.281, 1)
|
|
|
+// end::round[]
|
|
|
+| SORT height DESC, first_name ASC
|
|
|
+| LIMIT 3;
|
|
|
+
|
|
|
+// tag::round-result[]
|
|
|
+first_name:keyword | last_name:keyword | height:double | height_ft:double
|
|
|
+Arumugam |Ossenbruggen |2.1 |6.9
|
|
|
+Kwee |Schusler |2.1 |6.9
|
|
|
+Saniya |Kalloufi |2.1 |6.9
|
|
|
+// end::round-result[]
|
|
|
+;
|
|
|
+
|
|
|
+docsIsNull
|
|
|
+// tag::isNull[]
|
|
|
+FROM employees
|
|
|
+| KEEP first_name, last_name
|
|
|
+| WHERE IS_NULL(first_name)
|
|
|
+// end::isNull[]
|
|
|
+| LIMIT 3;
|
|
|
+
|
|
|
+// tag::isNull-result[]
|
|
|
+first_name:keyword | last_name:keyword
|
|
|
+null |Demeyer
|
|
|
+null |Joslin
|
|
|
+null |Reistad
|
|
|
+// end::isNull-result[]
|
|
|
+;
|
|
|
+
|
|
|
+docsNotIsNull
|
|
|
+// tag::notIsNull[]
|
|
|
+FROM employees
|
|
|
+| KEEP first_name, last_name
|
|
|
+| WHERE NOT IS_NULL(first_name)
|
|
|
+// end::notIsNull[]
|
|
|
+| LIMIT 3;
|
|
|
+
|
|
|
+// tag::notIsNull-result[]
|
|
|
+first_name:keyword | last_name:keyword
|
|
|
+Georgi |Facello
|
|
|
+Bezalel |Simmel
|
|
|
+Parto |Bamford
|
|
|
+// end::notIsNull-result[]
|
|
|
+;
|