diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLResultsetAbstract.java b/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLResultsetAbstract.java
index <HASH>..<HASH> 100755
--- a/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLResultsetAbstract.java
+++ b/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLResultsetAbstract.java
@@ -157,7 +157,7 @@ public abstract class OCommandExecutorSQLResultsetAbstract extends OCommandExecu
 

   protected Object getResult() {

     if (tempResult != null) {

-      for (OIdentifiable d : tempResult)

+      for (Object d : tempResult)

         if (d != null)

           request.getResultListener().result(d);

     }
SQL: flatten() now creates projection even on non-records