Jump to content

Help with a three table join?


Mr Chris

Recommended Posts

Hi All,

 

I am trying to join three tables with this query:

 

select pl.player_name AS the_player, pl.player_id, s.report_id
  from players as pl
left outer 
  join player_stats as s
    on s.player_id = pl.player_id
left outer 
  join r.reports as r 
    on r.report_id = s.report_id
where pl.player_id = 22

 

However I get the message:

 

SELECT command denied to user 'my_user_name'@'localhost' for table 'reports'

 

However if I just do it without the last join e.g. just a two table:

 

select pl.player_name AS the_player, pl.player_id, s.report_id
  from players as pl
left outer 
  join player_stats as s
    on s.player_id = pl.player_id
where pl.player_id = 22

 

It works fine, so it's getting lost somewhere here on the third join:

 

left outer 
  join r.reports as r 
    on r.report_id = s.report_id

 

But cant see where?  Any ideas?

 

Thanks

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.