Thought game: What if SQL had a type called 'Operator'

Say you have a query, inside a stored procedure, that said:

SELECT *
FROM People
WHERE Age > @Age

And then you had another stored procedure, almost identical, that said:

SELECT *
FROM People
WHERE Age <= @Age

It'd be nice to apply some modularisation to this problem and instead have one procedure that said:

SELECT *
FROM People
WHERE Age @Operator @Age

And so on. Without using dynamic sql. Discuss ;-)

 

My book "Choose Your First Product" is available now.

It gives you 4 easy steps to find and validate a humble product idea.

Learn more.

(By the way, I read every comment and often respond.)

Your comment, please?

Your Name
Your Url (optional)
Note: I may edit, reuse or delete your comment. Don't be mean.