Igor Tandetnik wrote:
> Puneet Kishor<punk.k...@gmail.com>  wrote:
>> steve mtangoo wrote:
>>>    I have a  script that is supposed to query the Bible scriptures between 
>>> two
>>> intervals. My table is named Bible and have columns: ID (int), Book (int),
>>> Chapter(int), Verse (int) and Scripture(text).
>>>
>>> Now the books are unique i.e. 1-66 but chapters keep repeating, and so do
>>> verses. Now suppose I want to get scripture between book 1 chapter 1 verse 1
>>> and book 2 chapter 3 Verse 1, how do I go about?
>>
>> SELECT Scripture
>> FROM Bible
>> WHERE
>>      Book>  0 AND Book<  3 AND
>>      Chapter>  0 AND Chapter<  4 AND
>>      Verse>  0 AND Verse<  2
>
> This excludes, for example, book 1 chapter 10. I'm pretty sure the OP wanted 
> it included.

Yes, of course, you are correct. Goes on to show that mapping what one 
thinks in the mind (a logical query) to SQL (a set query) can be nastily 
difficult.

Thanks for the correction.

-- 
Puneet Kishor http://punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Fellow http://creativecommons.org/about/people/fellows#puneetkishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
---------------------------------------------------------------------------
Assertions are politics; backing up assertions with evidence is science
===========================================================================
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to