Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

like expression in where clause

 
Vallaru smitha
Ranch Hand
Posts: 87
Firefox Browser Hibernate Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
could anyone please let me know what would be correct JPQl where statement that returns only numbers formatted xxxx-xxxx-xxxx (eg :1234-3453-2344) using "like"

thanks
vallaru.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think there's any LIKE patterns which allows you to get only numbers.
Maybe you could use LIKE '____-____-____', use SUBSTRING to break each group, and use BETWEEN 0 and 9999 to make sure it's a number.
 
Vallaru smitha
Ranch Hand
Posts: 87
Firefox Browser Hibernate Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks christophe, that helped.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic