- 1

BETWEEN clause SQL ... example says 'WHERE ID BETWEEN 3 AND 7' but results include 3 and 7, is this correct?

I would have expected the results to exclude the lower bound and the upper bound as we are asking for results between these (from from and to). I'm not sure if the example is wrong or if this is how SQL works?

9th Apr 2019, 7:05 AM
Mark Lindsay
2 Respostas
+ 1
Quoted from w3schools: "The BETWEEN operator is inclusive:begin and end values are included." https://www.w3schools.com/sql/sql_between.asp Hth, cmiiw
9th Apr 2019, 8:02 AM
Ipang
0
Between statement in sql included the lowest parameter and the highest parameter, thas how its work.
17th Apr 2019, 11:48 AM
Andri Hry
Andri Hry - avatar