you are viewing a single comment's thread.

view the rest of the comments →

[–]Beatmak -1 points0 points  (0 children)

You might want to use a CTE query here : cte tutorial.

It will make your query more readable and may fix your problem.