Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-02-07 : 10:13:45
|
| Andrew writes "Basically I want to produce a list of fields, where this list contains a particular known field value in the middle of the list.So if my field value is 'blue', I want to return the preceeding 5 records, the value I know, and then the following 5 records, according to the order by clause e.g.red, green, yellow, orange, BLUE, black, pink, lilac, purple, violetAny ideas?" |
|
|
chadmat
The Chadinator
1974 Posts |
Posted - 2002-02-07 : 13:21:31
|
| Well, With the limited information, I will give it a try. I am probably way off, because I don't know what your tables or your data look like.How aboutselect top 5 color from colortableorder by color descUNIONselect 'blue'UNIONselect top 5 color from colortableorder by color asc-Chad |
 |
|
|
|
|
|
|
|