inner join returning incorrect results

Problems with the Windows version of XAMPP, questions, comments, and anything related.

inner join returning incorrect results

Postby thedartgod » 22. September 2018 23:31

I truly hope this is in the correct place. I apologize in advance if I'm in error.

I've created this join:

SELECT teams.MemID, teams.Captain_flag, member.Email FROM member INNER JOIN teams ON member.MemID = teams.MemID WHERE SeasonID = 85 ORDER BY member.MemID ASC, teams.Captain_flag DESC

The teams table has 291 entries and the member has over 5500. When I execute it in phpMyAdmin it works: I get 291 results. When I execute from my php code I get 269 results. In addition to being 22 short, what I do get is not correct. I have not done an exhaustive search, but have found these 2 inconsistencies: (1) member 3143 is NOT in teams, but shows up in the join and (2) member 2068 is in teams 4 times but only shows up 3 times in the join.

Obviously, I prefer to use the join rather than access member 291 times.
thedartgod
 
Posts: 5
Joined: 26. February 2018 17:23
XAMPP version: win32-7.2.1-0
Operating System: Windows 10

Re: inner join returning incorrect results

Postby Altrea » 23. September 2018 01:00

Hi,

I don't have any idea how we can identify this issue without access to the data.
Phpmyadmin is executing SQL statements with PHP too, so there must be a different between your own method and the method phpmyadmin uses.

Best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: inner join returning incorrect results

Postby thedartgod » 23. September 2018 03:26

Okay. Thank-you. I was going to offer you (or others) access to the data. But, in updating the online database, I discovered that the join works as expected. It seems the problem is within my local development version of the database.

On another matter. Is this the correct place for me to be posting this type of item?

dave race
thedartgod
 
Posts: 5
Joined: 26. February 2018 17:23
XAMPP version: win32-7.2.1-0
Operating System: Windows 10


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 119 guests