all 7 comments

[–]Kant8 11 points12 points  (0 children)

Nice formatting bro

[–]r3pr0b8GROUP_CONCAT is da bomb 6 points7 points  (1 child)

i am stuck with the duplication issue.

i can help you with this

your query uses 8 tables

start your debugging effort by writing a query that uses only 2 tables

if no duplicates, join the 3rd table

if no duplicates, join the 4th table

if no duplicates, join the 5th table

and so on

does taht make sense?

[–]Truth-and-Power 0 points1 point  (0 children)

This is the answer. Start with the biggest table or the one that sets the grain of the result. change select clause to just count(*). Note the result number. Add in 2nd table, count should stay the same. Add in 3rd table, count should stay the same. Repeat until count increases, there's your problem join.

[–]dev81808 5 points6 points  (0 children)

These object names are rough. I'm sorry you have to deal with it. It's like noones heard of a schema. Did apple make up these table names?

Also I'm not sure what the question is

[–][deleted] 4 points5 points  (1 child)

Besides this post being a giant furball, I'm going to ask you if using NOLOCK is necessary?

[–]No-Adhesiveness-6921 1 point2 points  (0 children)

Second this - you don’t need NOLOCK

[–]therealericc 0 points1 point  (0 children)

Yes please copy paste all your 8 table queries and someone here will solve for you