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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 house number

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 all
select '12b apple avenue' union all
select '3b apple avenue' union all
select '32 apple avenue' union all
select '322 apple avenue' union all
select '3 apple avenue'

select * from @table

how 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?
Go to Top of Page

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
Go to Top of Page

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 Larsson
Helsingborg, Sweden
Go to Top of Page

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 Larsson
Helsingborg, Sweden
Go to Top of Page

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 improvement
2) Still working with same issues as last summer

quote:
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 Larsson
Helsingborg, Sweden
Go to Top of Page

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.
Go to Top of Page

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 all
select '12b apple avenue' union all
select '3b apple avenue' union all
select '32 apple avenue' union all
select '322 apple avenue' union all
select '3a22 apple avenue' union all
select 'a322 apple avenue' union all
select '3 apple avenue'

select
ad_str1
from
@table
where
substring(ad_str1,1,charindex(' ',ad_str1)-1) like '%[a-z]%'

Results:

ad_str1
----------------------------------------
123b apple avenue
12b apple avenue
3b apple avenue
3a22 apple avenue
a322 apple avenue

(5 row(s) affected)



CODO ERGO SUM
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-01-26 : 16:24:21
quote:
Originally posted by Michael Valentine Jones

Don't bother saying thanks. I know you don't mean it.



are you kidding? with a grateful expression like this, how could you doubt him?

http://www.sqlteam.com/forums/pop_profile.asp?mode=display&id=21160


www.elsasoft.org
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2007-01-26 : 16:45:20
quote:
Originally posted by jezemine
are you kidding? with a grateful expression like this, how could you doubt him?

http://www.sqlteam.com/forums/pop_profile.asp?mode=display&id=21160


www.elsasoft.org



He always has a load of BS in his profile. Look at the bio.




CODO ERGO SUM
Go to Top of Page
   

- Advertisement -