I have a tblTags table that works almost the same as the StackOverflows tagging system.
When I look at a tag page, say a Tutorial tag, I want to display 10 tags before and after it in alphabetical order.
So, if we are assigned the Tutorial tag of identifier 30 , how can we return the recordset in an order resembling:
Tap Tart > Tutorial Umbrellas Unicorns Xylaphones
I thought about how to do it badly, in my opinion, since they involve getting ugly amounts of data.
I'm not sure if it is possible to do something line by line (pseudo):
SELECT RANGE(0 - 30) FROM tblTags ORDER BY Name ASC
But how do you know the position of a textbook tag in a list in an efficient way, without going through the whole list until you find it?
I am using SQL Server 2008 R2 Express with LINQ, if that matters, SQL queries or LINQ will be great answers, thanks!
source share