selecting a range of verses from a database
Posted
by
Noam Smadja
on Stack Overflow
See other posts from Stack Overflow
or by Noam Smadja
Published on 2011-01-17T18:51:20Z
Indexed on
2011/01/17
18:53 UTC
Read the original article
Hit count: 252
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
© Stack Overflow or respective owner