Saturday, May 16, 2009

TSQL Between

I've been spending A LOT of my time in SQL logic lately. It's been pretty rare that I've opened up Visual Studio. Not necessarily pleased with this but one bonus is that I've learned a bit more about SQL. I just found out the other day that you there is a SQL operator called BETWEEN. It allows you select a range of values:

SELECT *
FROM MyTable
WHERE Year
BETWEEN 2000 AND 2009

I guess you're never too old to learn some new tricks.

No comments: