View Single Post
Old 05-16-2004, 11:51 PM   #1 (permalink)
seretogis
Huggles, sir?
 
seretogis's Avatar
 
Location: Seattle
[MySQL] My brain blew a fuse (multi-table select, joins)

I had a brain fart and posted this in the Computer forum by mistake. Here it is, again, in the correct forum:

Hi!

So, I'm working on a secret project thing which involves one record needing to be selected, along with info from a few other tables. The base record, "enhancement" needs to grab the origin(s) from the origin table, using the enhancement/origin join table, as well as effect(s) from the effect table, using the enhancement/effect join table, and finally, the server using the server_id and server table.

I want this:
Enhancement table values
Origin(s) - from the origin table
Server - from the server table
Effect(s) - from the effect table

Schemas:

Code:
*yoink*
So far I have just the table / field declarations, and my brain is getting fried on everything after the "WHERE" :P I will now go to sleep and look at it again this morning, with clearer head and vision.

Here's my query right now:
Code:
*yoink*
This returns the one result that I have in the db, with all fo the fields merged, however the resulting entry for "origin" contains only one of the two values:

Code:
*yoink*

..and my query results:

Code:
*yoink*
Assume that we're being provided with an origin id, server id, and effect id with which to narrow down the list of enhancements. Any hints are appreciated.
__________________
seretogis - sieg heil
perfect little dream the kind that hurts the most, forgot how it feels well almost
no one to blame always the same, open my eyes wake up in flames

Last edited by seretogis; 05-20-2004 at 05:59 AM..
seretogis is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73