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
 String comparison like char+number

Author  Topic 

visak_mr
Starting Member

3 Posts

Posted - 2009-10-27 : 03:31:50
Hi,
How can I
select records where id like 'A203098330'

ie like A[0..9]
ie single CHAR followed by NUMBERS

Thanks,
Visakh

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-10-27 : 03:40:34
If it is fixed length

select records where id like 'A[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]%'


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

visak_mr
Starting Member

3 Posts

Posted - 2009-10-27 : 04:10:41
but it's not a fixed length string??
but the trailing places are numbers i was looling for something like [0-9]*
Go to Top of Page

visak_mr
Starting Member

3 Posts

Posted - 2009-10-27 : 04:18:09
and 'A[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]%'
is not working in oracle.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-10-27 : 04:45:52
quote:
is not working in oracle

This is a MS Sql Server forum.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-10-27 : 05:12:43
quote:
Originally posted by visak_mr

and 'A[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]%'
is not working in oracle.



Oracle has some reg_index functions. Post your question at www.orafaq.com

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -