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 ;-)

 

I'm currently writing a book about how to build your first product. If you want to build your first product, please sign up to be notified when the book is available.

(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.