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
 SQL Server 2008 Forums
 Transact-SQL (2008)
 how SQL statement recognize 5 digit number?

Author  Topic 

Idyana
Yak Posting Veteran

96 Posts

Posted - 2011-12-31 : 04:11:53
Let's say my table and data as following,

declare @t1 table
(col1 varchar(30))

insert into @t1 values('72000 KUALA PILAH');
insert into @t1 values('JALAN KELAB, 73000 TAMPIN, ');
insert into @t1 values('71000 PORT DICKSON');
insert into @t1 values('TG. IPOH, 71500 KUALA PILAH,');
insert into @t1 values('TAMPIN 34789');


how to recognize 5 digit number?

my expected result,
@t1
myNumber
---------------------
72000
73000
71000
71500
34789

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-12-31 : 07:14:53
use the function here http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=79083


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

Idyana
Yak Posting Veteran

96 Posts

Posted - 2011-12-31 : 08:06:19
tq sir
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-12-31 : 08:08:50
welcome


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -