This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Last revision Both sides next revision | ||
sample_queries [2019/03/24 15:02] steve |
sample_queries [2019/03/24 15:19] steve |
||
---|---|---|---|
Line 33: | Line 33: | ||
</code> | </code> | ||
+ | ===== Random Book of Psalms ===== | ||
+ | Display the verses from one chapter of the book of Psalms chosen randomly: | ||
+ | |||
+ | <code> | ||
+ | SELECT v.scripture_text FROM verses v WHERE v.chapter_id IN (SELECT c.id FROM chapters c JOIN books b ON b.id = c.book_id WHERE b.book_title = 'Psalms' ORDER BY RANDOM() LIMIT 1) ORDER BY v.id; | ||
+ | </code> | ||
+ | |||
+ | Result: | ||
+ | |||
+ | <code> | ||
+ | Praise ye the Lord. Praise ye the Lord from the heavens: praise him in the heights. | ||
+ | Praise ye him, all his angels: praise ye him, all his hosts. | ||
+ | Praise ye him, sun and moon: praise him, all ye stars of light. | ||
+ | Praise him, ye heavens of heavens, and ye waters that be above the heavens. | ||
+ | Let them praise the name of the Lord: for he commanded, and they were created. | ||
+ | He hath also stablished them for ever and ever: he hath made a decree which shall not pass. | ||
+ | Praise the Lord from the earth, ye dragons, and all deeps: | ||
+ | Fire, and hail; snow, and vapour; stormy wind fulfilling his word: | ||
+ | Mountains, and all hills; fruitful trees, and all cedars: | ||
+ | Beasts, and all cattle; creeping things, and flying fowl: | ||
+ | Kings of the earth, and all people; princes, and all judges of the earth: | ||
+ | Both young men, and maidens; old men, and children: | ||
+ | Let them praise the name of the Lord: for his name alone is excellent; his glory is above the earth and heaven. | ||
+ | He also exalteth the horn of his people, the praise of all his saints; even of the children of Israel, a people near unto him. Praise ye the Lord. | ||
+ | </code> |