return query on console