Thanks r937. I'm trying to explain this the best way that I can, so here's putting it in more conversational English.
There's 4 tables:
"wp_posts" contains rows of content.
"wp_terms" is a table of categories.
"wp_term_relationships" ties categories by their id in wp_terms to their object_id in wp_posts.
"wp_postmeta" is a table containing custom fields and their values, tied to a record in wp_posts by id.
"wp_term_relationships" ties posts to categories
object_id (essentially wp_posts.id), category_id (essentially wp_terms.id)
custom_fieldname, custom_fieldvalue, content_id (essentially wp_posts.id)
So what I'm trying to do is tie everything together, and putting it in simple english, "I'm trying to select all posts of a certain category and order them according to a custom field called 'slot'."
Which would come up like this:
SELECT id, content FROM wp_posts WHERE id=(JOIN: SELECT object_id's FROM wp_term_relationships WHERE category_id=(JOIN: SELECT id's FROM wp_terms WHERE category_name="home")) ORDER BY (JOIN SELECT wp_postmeta.fieldvalue WHERE wp_postmeta.content_id=wp_posts.id AND wp_postmeta.fieldname="slot")
It just looks like a mess when it's typed out like that.