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 |
|
waxdart23
Starting Member
33 Posts |
Posted - 2005-04-02 : 11:30:34
|
| I'm trying to write a select statement to find all the unique first letters in UK postcodes from a table containing all UK postcodes but I am stuckSo for example if my table had:NE13 6RUNE7 7BBLS3 4EBL23 3BPSW7 2APThe select statment I am trying to write would give me:NELSLSWThanksPaulThanksP |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2005-04-02 : 11:51:45
|
| SELECT DISTINCT Left(PostCode, PatIndex('%[^a-z]%', PostCode)-1)FROM myTable |
 |
|
|
waxdart23
Starting Member
33 Posts |
Posted - 2005-04-02 : 12:45:13
|
| Thanks RobvolkThanksP |
 |
|
|
|
|
|