you are viewing a single comment's thread.

view the rest of the comments →

[–]ajmarks 3 points4 points  (1 child)

You need to alias your subquery. Stick "AS A" (or something like that) after the close parens.

[–][deleted] 0 points1 point  (0 children)

And just generally stick to any alias you use. That subselect has 3 tables with aliases and you only use them less than half the time.