I found that there should be an error in the query when it was copied to another (supposedly identical) database, and this failed. It looks something like this:
SELECT a.columnOne , b.columnOne FROM TableOne a INNER JOIN TableTwo b ON a.id = b.id WHERE a.Value = 0 ORDER BY a.ColumnOne , b.ColumnTwo
The βerrorβ is that TableTwo does not have a column named columnTwo (used in the ORDER BY clause), but it works fine. At least this is done in one of the databases, and the other complains. But I'm sure it doesn't have TableTwo.columnTwo.
It might be worth mentioning that TableOne has a column named columnTwo.
This is an easy fix, but it pushes me that it has existed for so long without any problems. Any idea what could go on? (Or more information that I could give?)
source share