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 |
|
gmunky
Starting Member
5 Posts |
Posted - 2007-03-28 : 12:27:08
|
| I was wondering if there's an easy way to just retrieve records of strings given the first two characters and the last two characters.if the table looks like this:-----------hellohemmmlohemmmmjlhennnnlo------------ I want to be able to retrieve all strings that begins with 'he'and ends with 'lo' which are hello,hemmmlo,and hennnnloI tried using select from table where string = '%lo' and string='he%'but that doesnt work.thanks. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-03-28 : 12:31:23
|
[code]select * from tablewhere col like 'he%lo'[/code] KH |
 |
|
|
|
|
|