selecting a range of verses from a database
- by Noam Smadja
i have a database, with verses from the bible, with those fields:
book (book number), chapter (chapter number), verse (verse number), text (the verse)
example: 1 1 1 In the beginning God created the heaven and the earth.
first 1 is for Genesis, second 1 is for chapter 1, third 1 is for verse 1
user gives me something like 1 1:1 - 1 1:4 which means he wants to show Genesis 1:1-4.
what i want to do is something like SELECT book*100000+chapter*1000+verse AS index FROM bible WHERE index >= 1001001 AND index <=1001004 or WHERE book*100000+chapter*1000+verse >= 1001001 AND book*100000+chapter*1000+verse <= 1001004