![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a directory of user information. What I would like to do is allow someone to search for person X and then return not only the information for person X, but also the information for the next 15 people following person X sorted alphabetically by lastname. So if someone searched for the lastname = "Samson", it would return: Samson, John Saxton, Greg Scott, Heather Sears, Rebecca ... (15 names following "Samson) ... How do you in SQL return a record set of X records starting at particular record (e.g. lastname = "Smith)? Thanks in advance. |
#3
| |||
| |||
|
|
I have a directory of user information. What I would like to do is allow someone to search for person X and then return not only the information for person X, but also the information for the next 15 people following person X sorted alphabetically by lastname. So if someone searched for the lastname = "Samson", it would return: Samson, John Saxton, Greg Scott, Heather Sears, Rebecca .... (15 names following "Samson) ... How do you in SQL return a record set of X records starting at particular record (e.g. lastname = "Smith)? |
#4
| |||
| |||
|
|
(I forget, how does/doesn't SELECT TOP 15 work in SQL 2K vs 2K5? I haven't had occasion to need to remember.) |
#5
| |||
| |||
|
|
Ed Murphy (emurphy42 (AT) socal (DOT) rr.com) writes: (I forget, how does/doesn't SELECT TOP 15 work in SQL 2K vs 2K5? I haven't had occasion to need to remember.) They work the same. But SQL 2005 also has SELECT TOP(<expr)), so that you can have a variable - or something even more complex. |
![]() |
| Thread Tools | |
| Display Modes | |
| |