What’s the most efficient way to get two queries based on an if statement?

What’s the most efficient way to get two queries based on an if statement?