If you’re running a subquery in SQL Server, but you’re getting error 102 that reads something like “Incorrect syntax near ‘;’“, there could be any number of reasons, because this is a generic error that simply means wrong syntax.
But one possible cause could be that you haven’t declared an alias for the subquery.
Continue reading