Query formatting.