I love this like I love my old math teacher -- all formulas and no English.
"Just look at the chicken scratch and you'll figure it out, son!"
Could you tell us, using some rudimentary English, just what this query is supposed to do, please?
Yeah, I know. Just look at the chicken scratch and you'll figure it out! :-)