[GIS] Using sub-query in where statement of query in ArcGIS Map service

arcgis-10.2enterprise-geodatabasemap-servicesql server

I'm migrating my ArcGIS map services from version 10.0 to 10.2. It uses ArcSDE to manage spatial data in a SQL Server database. I was able to create the map service and everything seems OK. However if I add a sub-query in the WHERE statement of a query form in any map service, I receive "Unable to complete operation." error as the following image:
enter image description here

The same query was working in ArcGIS server 10.0. Also I can run the same query to select data, when I use the map document directly from ArcMap 10.2.
The ArcGIS Server 10.2, ArcSDE, and SQL Server are installed on a server which is internally accessible from the web server. The ArcGIS Web Adaptor is installed on the web server. Both servers have windows Server 2008 and IIS.

Best Answer

I found this article About standardized queries. It says that sub queries are not supported using standardized queries. But standardized queries can be disabled. I'm not sure if that means sub queries will work if you disable standardized queries though.

Related Question