From 726155383d6e8e41a6b8bec04f7e9c3277a2c397 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 7 Apr 2011 23:32:07 +0000 Subject: [PATCH] higher compatibility with MSSQL 2000 ("ORDER BY items must appear in the select list if the statement contains a UNION operator.") as we always take the first field from the list as the one for referencing (field = expressionFieldsList[0]) --- lib/core/agent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/agent.py b/lib/core/agent.py index 482ebcd3d..70b48da4e 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -688,7 +688,7 @@ class Agent: limitedQuery = "%s WHERE ISNULL(%s,' ') " % (limitedQuery, uniqueField or field) limitedQuery += "NOT IN (%s" % (limitStr % num) - limitedQuery += "ISNULL(%s,' ') %s ORDER BY %s) ORDER BY %s" % (uniqueField or field, fromFrom, uniqueField or field, uniqueField or field) + limitedQuery += "ISNULL(%s,' ') %s ORDER BY 1) ORDER BY 1" % (uniqueField or field, fromFrom) else: if " WHERE " in limitedQuery: limitedQuery = "%s AND %s " % (limitedQuery, field)