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 |
|
vladibo
Starting Member
11 Posts |
Posted - 2004-06-09 : 10:14:48
|
| I have a list of DB result ordered by something how can retrieve those that start with specific one keeping the same order. Here is an ezample.SELECT * FROM MyTbl ORDER BY nameID NAME------------30 Aaaa20 Bbbb3 Cccc41 Dddd5 Eeee6 Ffff8 Gggg7 HhhhSo I need for example to select 5 starting with 'Cccc' and have this resultID NAME------------3 Cccc41 Dddd5 Eeee6 Ffff8 GgggThank you in advance |
|
|
raymondpeacock
Constraint Violating Yak Guru
367 Posts |
Posted - 2004-06-09 : 10:27:49
|
| How aboutSELECT TOP 5 * FROM MyTbl WHERE name >= 'Cccc' ORDER BY nameRaymond |
 |
|
|
vladibo
Starting Member
11 Posts |
Posted - 2004-06-09 : 10:44:19
|
| Oh Thanks its really simple... |
 |
|
|
|
|
|