pull out query