Friday, February 24, 2012

Alpha Prefix - Can it be done in SQL?

Good Morning Db forum.
I am working on a query that I need to pull all fields that contain 3 alpha characters. for example BCB001, MCR001, CHP001 and so forth.
Is there a SQL alpha wildcard that I could use to pull all records that have the three alpha chars?where patindex('%[a-z][a-z][a-z]%',daColumn) > 0

:)|||Awesome thank you. Now would that be the same for say numbers/digits?

where patindex like [0-9][0-9][a-z]% if i wanted to return 145A or something along those lines?|||something along those lines -- you should test it yourself :)

No comments:

Post a Comment