| Author |
Topic |
|
gongxia649
So Suave
344 Posts |
Posted - 2007-01-26 : 13:48:43
|
| declare @table table(ad_str1 varchar(200))insert @table select '123b apple avenue' union allselect '12b apple avenue' union allselect '3b apple avenue' union allselect '32 apple avenue' union allselect '322 apple avenue' union allselect '3 apple avenue' select * from @tablehow to select the records where the house number contain letter. |
|
|
gongxia649
So Suave
344 Posts |
Posted - 2007-01-26 : 14:13:59
|
| hello? what happened to da fast replies?does the guys who helped me dont work in here anymore? |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2007-01-26 : 14:16:21
|
| What's the big hurry?CODO ERGO SUM |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-26 : 15:19:03
|
| Especially since we have known your address queries for the past 6 months...Peter LarssonHelsingborg, Sweden |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-26 : 15:19:59
|
| select * from table1 where col1 like '%[0-9][a-z] %'Peter LarssonHelsingborg, Sweden |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-26 : 15:28:38
|
Gonxia649, do you live in Argentina and not Albania any more?The reason (at least I think) is that you do not feel serious about SQL.You just want your immediate SQL needs satisfied.1) You show no signs of improvement2) Still working with same issues as last summerquote: Originally posted by gongxia649 hello? what happened to da fast replies?
We are not here for your relief only.quote: Originally posted by gongxia649 does the guys who helped me dont work in here anymore?
We help out for free on our spare times. We don't get paid for this.Peter LarssonHelsingborg, Sweden |
 |
|
|
gongxia649
So Suave
344 Posts |
Posted - 2007-01-26 : 15:32:41
|
| i actualy improved. and i wrote the same statement as u did.I just wanted to cmpare statements this time.i read an article we are no supposed to use "like" cause it hurts performance. well u r using like in your statement. so i guess my query is ok. |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2007-01-26 : 15:35:30
|
Don't bother saying thanks. I know you don't mean it.declare @table table(ad_str1 varchar(200))insert @table select '123b apple avenue' union allselect '12b apple avenue' union allselect '3b apple avenue' union allselect '32 apple avenue' union allselect '322 apple avenue' union allselect '3a22 apple avenue' union allselect 'a322 apple avenue' union allselect '3 apple avenue' select ad_str1from @tablewhere substring(ad_str1,1,charindex(' ',ad_str1)-1) like '%[a-z]%'Results:ad_str1----------------------------------------123b apple avenue12b apple avenue3b apple avenue3a22 apple avenuea322 apple avenue(5 row(s) affected) CODO ERGO SUM |
 |
|
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
|
|
|