Jump to content

Pulling a record more than once?


ShadowMage

Recommended Posts

Hey guys, I have an issue. In one of our reports at work there is duplicated information being displayed. I checked the database and there is only one record there. (Obviously, since there would be issues with duplicated primary key values, but I thought I'd check anyway...)How exactly does this happen? How do I track down the problem? I noticed the query uses a lot of left joins on the same table (ex. tblA left join tblB, tblA left join tblC, tblA left join tblD). Could this have something to do with it?Any advice is appreciated.

Link to comment
Share on other sites

Yep. Very likely that this is the cause. You can use "SELECT DISTINCT" to eliminate duplicate rows, but if there's even one column with a different value, it will appear. Doing more filtering would be trickier.

Link to comment
Share on other sites

Yep. Very likely that this is the cause. You can use "SELECT DISTINCT" to eliminate duplicate rows, but if there's even one column with a different value, it will appear. Doing more filtering would be trickier.
Thanks for confirming! :)I think for right now I'm going to dig into the database to see if I can figure something out. DISTINCT isn't going to work because I noticed that a couple of fields are different, but thanks for the suggestion. Just need to figure out which tables those fields belong to and why they're different. :) Oughtta be fun! :)
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...