• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

NOT BETWEEN in EJB-QL?

 
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 >
 
reply
    Bookmark Topic Watch Topic
  • New Topic