And and Where in inner queries