• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NOT BETWEEN in EJB-QL?

 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, in case we have the following values:

A, B, C, D

the following query (excuse me the meaningless context):

SELECT OBJECT(o) from LettersSchema o
WHERE o.id NOT BETWEEN A AND D

would return A and D? In few words, I know the NOT BETWEEN is exclusive, does this mean that the first and the last values are not included in the WHERE clause?
 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, found the answer myself. Specs, 11.2.7.7


p.age NOT BETWEEN 15 and 19 is equivalent to p.age < 15 OR p.age > 19
 
Olexiy Prokhorenko
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
..and BETWEEN is equal to >= ... =<, yup?

(just to check myself) :-)
 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Alexey Prohorenko:
..and BETWEEN is equal to >= ... =<, yup?

(just to check myself) :-)


Yup. BETWEEN is inclusive (it means the boundaries of the selection are included - From here...>= =< ; NOT BETWEEN is exclusive (the boundaries are not included - From here < and >
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic