sql using multiple with statements