Jump to content

Complicated Query...


Andy Booth

Recommended Posts

Ok, i'll try explain this the best way I can.......

SELECT users.user_name, games.game_name, games.game_console, offer.game1_id, offer.game2_id, offer.game3_id, offer.game4_id, offer.game5_id, offer.all_games, offer.secure, offer.status, owned.game_id, owned.master_id FROM users, games, offer, owned WHERE (users.master_id = '2') AND (offer.user_id = '2') AND (owned.game_id = games.game_id).

The 'owned.master_id' has a different value to the value I have specified as being '2' for the users.master_id. The thing is, I want to get the username (from the users table) for the member whos master id is owned.master_id. Can I do this all in one query? I want it along with everything else i've already successfully retrieved..

Thanks :)
Link to comment
Share on other sites

I'm not sure what you mean exactly...so i'll try explain the whole situation...

I want a query that will do the following.

Retrieve records from a table called offer. I want to retrieve games.game_name and games.game_console using the offer.game_id which links to games.game_id. From the offer table also contains the master_id of the member the offer is being offered to. I want to get the user_name of that master_id which can be found in the users table.

Does this help? :)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.