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 |
|
Shilpa22
Starting Member
37 Posts |
Posted - 2010-06-28 : 04:02:24
|
| Hello All,I have a varchar column(approvers).for example it returns the below result set,392813392813GroupName_EU882647ADGRoup_EU11955 123456aaaaaaFrom the above result set. I want only the values which have character, excluding all the int values.Pls help in thisTHanksThanks in AdvanceShilpa |
|
|
pk_bohra
Master Smack Fu Yak Hacker
1182 Posts |
Posted - 2010-06-28 : 04:28:34
|
| Try this:One of the simple ways. There may be other ways for achieving the sameselect * from yourtable where approvers like '%[a-z]%'Example:Declare @r table(approvers varchar(50))Insert into @rSelect '392813' unionSelect 'GroupName_EU' unionSelect '882647' unionSelect '123456' unionSelect 'ADGRoup_EU' unionSelect 'aaaaaa' select * from @r where approvers like '%[a-z]%'Regards,BohraI am here to learn from Masters and help new bees in learning. |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2010-06-28 : 04:36:52
|
What to do with "123abc" values? N 56°04'39.26"E 12°55'05.63" |
 |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
|
|
Shilpa22
Starting Member
37 Posts |
Posted - 2010-06-28 : 05:15:48
|
| THanks a lot. It worked.Thanks in AdvanceShilpa |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-06-28 : 08:59:15
|
| orselect * from @r where approvers like '%[^0-9]%'MadhivananFailing to plan is Planning to fail |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2010-06-28 : 09:02:04
|
There is still the issue of mixed content; "What do to with values like 'ABC123' "... N 56°04'39.26"E 12°55'05.63" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-06-28 : 09:06:44
|
quote: Originally posted by Peso There is still the issue of mixed content; "What do to with values like 'ABC123' "... N 56°04'39.26"E 12°55'05.63"
OP needs to clarify itMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|