# Selecting table entries depending upon entry in another table

**URL:** https://forum.kirupa.com/t/selecting-table-entries-depending-upon-entry-in-another-table/270651
**Category:** programming
**Created:** [September 12, 2008, 1:56am UTC](https://forum.kirupa.com/t/selecting-table-entries-depending-upon-entry-in-another-table/270651 "2008-09-12T01:56:30Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Icy\_Penguin](https://avatars.discourse-cdn.com/v4/letter/i/f6c823/32.png) [@Icy\_Penguin](https://forum.kirupa.com/u/Icy_Penguin)
#### Post date: [September 12, 2008, 1:56am UTC](https://forum.kirupa.com/t/selecting-table-entries-depending-upon-entry-in-another-table/270651/1 "2008-09-12T01:56:30Z")

</div>

I’ve got one table - called ‘posts’ which has the price and quality of a book someone would be selling, as well as an entry called ‘book’ - which is the reference to the id of a row in another table (‘books’), which contains the title, author, edition, etc…

I’d like to, within a single query, select the price (which would be from ‘posts’ and the title, author, edition, etc. (from ‘books’) in one statement).

So, something like this (except I’m getting errors):

SELECT (posts.price, posts.id FROM posts), (books.title, books.price WHERE id = posts.book)

Thanks 🙂
