rspec/rules/S1737/rule.adoc

24 lines
425 B
Plaintext
Raw Normal View History

2020-06-30 12:47:33 +02:00
According to SQL-92:
2021-01-06 17:38:34 +01:00
____
2020-06-30 12:47:33 +02:00
"X BETWEEN Y AND Z" is equivalent to "X>=Y AND X<=Z"
2021-01-06 17:38:34 +01:00
____
2020-06-30 12:47:33 +02:00
2021-01-27 13:42:22 +01:00
Even if the ``++BETWEEN++`` predicate is simply syntactic sugar, using it can improve the readability of a SQL WHERE clause, and is therefore preferred.
2020-06-30 12:47:33 +02:00
== Noncompliant Code Example
----
SELECT * FROM PERSONS
WHERE AGE >=18 and AGE <=60
----
== Compliant Solution
----
SELECT * FROM PERSONS
WHERE AGE BETWEEN 18 and 60
----